private void WpfMap_Loaded(object sender, RoutedEventArgs e) { ClusterPointStyle clusterPointStyle1 = new ClusterPointStyle(PointSymbolType.Triangle, new GeoSolidBrush(GeoColor.FromArgb(150, GeoColor.StandardColors.Orange)), new GeoPen(GeoColor.StandardColors.Red, 2), 27); ClusterPointStyle clusterPointStyle2 = new ClusterPointStyle(PointSymbolType.Cross, new GeoSolidBrush(GeoColor.FromArgb(150, GeoColor.StandardColors.Orange)), new GeoPen(GeoColor.StandardColors.Red, 2), 27); shpLayer = new ShapeFileFeatureLayer(@"..\..\sampledata\data\majorcities.shp"); shpLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level04; shpLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(clusterPointStyle1); shpLayer.ZoomLevelSet.ZoomLevel05.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level06; shpLayer.ZoomLevelSet.ZoomLevel05.CustomStyles.Add(clusterPointStyle2); shpLayer.ZoomLevelSet.ZoomLevel07.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; shpLayer.ZoomLevelSet.ZoomLevel07.CustomStyles.Add(PointStyles.Capital1); shpLayer.Open(); inmLayer = new InMemoryFeatureLayer(); inmLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital3; LayerOverlay ovForShpLayer = new LayerOverlay(); ovForShpLayer.Layers.Add(shpLayer); ovForInmLayer = new LayerOverlay(); ovForInmLayer.Layers.Add(inmLayer); Map1.MapClick += new EventHandler(Map1_MapClick); Map1.CurrentExtent = shpLayer.GetBoundingBox(); Map1.MapUnit = GeographyUnit.DecimalDegree; Map1.Overlays.Add(ovForShpLayer); Map1.Overlays.Add(ovForInmLayer); Map1.Refresh(); } LayerOverlay ovForInmLayer; InMemoryFeatureLayer inmLayer; ShapeFileFeatureLayer shpLayer; void Map1_MapClick(object sender, MapClickWpfMapEventArgs e) { Collection clickedFeatures = shpLayer.FeatureSource.GetFeaturesNearestTo(new PointShape(e.WorldX, e.WorldY), GeographyUnit.DecimalDegree, 1, new Collection(), 10, DistanceUnit.Kilometer); if (clickedFeatures.Count > 0) { inmLayer.InternalFeatures.Clear(); inmLayer.InternalFeatures.Add(clickedFeatures[0]); } Map1.Refresh(); }