private void WpfMap_Loaded(object sender, RoutedEventArgs e) { wpfMap1.MapUnit = GeographyUnit.DecimalDegree; InMemoryFeatureLayer inmLayerWith5000Features = new InMemoryFeatureLayer(); inmLayerWith5000Features.Open(); inmLayerWith5000Features.Columns.Add(new FeatureSourceColumn("id")); inmLayerWith5000Features.Close(); inmLayerWith5000Features.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; inmLayerWith5000Features.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayerWith5000Features.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Antarctical("id"); InMemoryFeatureLayer inmLayerWith12500Features = new InMemoryFeatureLayer(); inmLayerWith12500Features.Open(); inmLayerWith12500Features.Columns.Add(new FeatureSourceColumn("id")); inmLayerWith12500Features.Close(); inmLayerWith12500Features.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; inmLayerWith12500Features.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayerWith12500Features.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Antarctical("id"); InMemoryFeatureLayer inmLayerWith50000Features = new InMemoryFeatureLayer(); inmLayerWith50000Features.Open(); inmLayerWith50000Features.Columns.Add(new FeatureSourceColumn("id")); inmLayerWith50000Features.Close(); inmLayerWith50000Features.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; inmLayerWith50000Features.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayerWith50000Features.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Antarctical("id"); Random random = new Random(); for (int i = 0; i < 5000; i++) { Feature feature = new Feature(random.Next(-180, 180), random.Next(-90, 90)); feature.ColumnValues.Add("id", "the " + i.ToString() + " feature in inmLayerWith5000Features"); inmLayerWith5000Features.InternalFeatures.Add(feature); } for (int i = 0; i < 12500; i++) { Feature feature = new Feature(random.Next(-180, 180), random.Next(-90, 90)); feature.ColumnValues.Add("id", "the " + i.ToString() + " feature in inmLayerWith5000Features"); inmLayerWith12500Features.InternalFeatures.Add(feature); } for (int i = 0; i < 50000; i++) { Feature feature = new Feature(random.Next(-180, 180), random.Next(-90, 90)); feature.ColumnValues.Add("id", "the " + i.ToString() + " feature in inmLayerWith5000Features"); inmLayerWith50000Features.InternalFeatures.Add(feature); } LayerOverlay ov1 = new LayerOverlay(); ov1.Layers.Add(inmLayerWith5000Features); ov1.Layers.Add(inmLayerWith12500Features); ov1.Layers.Add(inmLayerWith50000Features); InMemoryFeatureLayer inmLayerWith5Features = new InMemoryFeatureLayer(); inmLayerWith5Features.Open(); inmLayerWith5Features.Columns.Add(new FeatureSourceColumn("id")); inmLayerWith5Features.Close(); inmLayerWith5Features.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; inmLayerWith5Features.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayerWith5Features.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Antarctical("id"); InMemoryFeatureLayer inmLayerWith2000Features = new InMemoryFeatureLayer(); inmLayerWith2000Features.Open(); inmLayerWith2000Features.Columns.Add(new FeatureSourceColumn("id")); inmLayerWith2000Features.Close(); inmLayerWith2000Features.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; inmLayerWith2000Features.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayerWith2000Features.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Antarctical("id"); for (int i = 0; i < 5; i++) { Feature feature = new Feature(random.Next(-180, 180), random.Next(-90, 90)); feature.ColumnValues.Add("id", "the " + i.ToString() + " feature in inmLayerWith5000Features"); inmLayerWith5Features.InternalFeatures.Add(feature); } for (int i = 0; i < 2000; i++) { Feature feature = new Feature(random.Next(-180, 180), random.Next(-90, 90)); feature.ColumnValues.Add("id", "the " + i.ToString() + " feature in inmLayerWith5000Features"); inmLayerWith2000Features.InternalFeatures.Add(feature); } LayerOverlay ov2 = new LayerOverlay(); ov2.Layers.Add(inmLayerWith5Features); ov2.Layers.Add(inmLayerWith2000Features); wpfMap1.Overlays.Add(ov1); wpfMap1.Overlays.Add(ov2); ov1.Drawing += new EventHandler(ov1_Drawing); ov1.Drawn += new EventHandler(ov1_Drawn); ov2.Drawing += new EventHandler(ov2_Drawing); ov2.Drawn += new EventHandler(ov2_Drawn); wpfMap1.CurrentExtent = new RectangleShape(-180, 90, 180, -90); wpfMap1.Refresh(); } void ov2_Drawn(object sender, DrawnOverlayEventArgs e) { System.Diagnostics.Debug.WriteLine("ov1 STOP Time:" + stopwatch.Elapsed.TotalMilliseconds); } void ov2_Drawing(object sender, DrawingOverlayEventArgs e) { if (!stopwatch.IsRunning) { stopwatch.Start(); } } Stopwatch stopwatch = new Stopwatch(); void ov1_Drawn(object sender, DrawnOverlayEventArgs e) { System.Diagnostics.Debug.WriteLine("ov2 STOP Time:" + stopwatch.Elapsed.TotalMilliseconds); } void ov1_Drawing(object sender, DrawingOverlayEventArgs e) { if (!stopwatch.IsRunning) { stopwatch.Start(); } }