private void WpfMap_Loaded(object sender, RoutedEventArgs e) { Map1.MapUnit = GeographyUnit.DecimalDegree; Map1.CurrentExtent = new RectangleShape(-155.733, 95.60, 104.42, -81.9); inmLayer = new InMemoryFeatureLayer(); inmLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; inmLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Country1("Name"); inmLayer.Open(); inmLayer.Columns.Add(new FeatureSourceColumn("Name")); Feature feature1 = new Feature(0, 0); feature1.ColumnValues.Add("Name", "good0"); Feature feature2 = new Feature(0, 20); feature2.ColumnValues.Add("Name", "good1"); inmLayer.InternalFeatures.Add(feature1); inmLayer.InternalFeatures.Add(feature2); LayerOverlay ov = new LayerOverlay(); ov.TileType = TileType.SingleTile; ov.Layers.Add(inmLayer); Map1.Overlays.Add(_pointsOverlay); Map1.Overlays.Add(ov); Map1.MapClick += new System.EventHandler(Map1_MapClick); Map1.Refresh(); } LayerOverlay _pointsOverlay = new LayerOverlay() { TileType = TileType.SingleTile }; InMemoryFeatureLayer _pointsLayer = new InMemoryFeatureLayer(); InMemoryFeatureLayer inmLayer; void Map1_MapClick(object sender, MapClickWpfMapEventArgs e) { inmLayer.Open(); var ClickedFeature = inmLayer.FeatureSource.GetFeaturesNearestTo(e.WorldLocation, Map1.MapUnit, 1, inmLayer.InternalFeatures[0].ColumnValues.Keys, 1000, DistanceUnit.Kilometer)[0]; inmLayer.InternalFeatures.Clear(); _pointsLayer = new InMemoryFeatureLayer(); _pointsLayer.Open(); _pointsLayer.Columns.Add(new FeatureSourceColumn("Name")); _pointsLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Country1("Name"); _pointsLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; _pointsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; _pointsLayer.InternalFeatures.Clear(); _pointsLayer.InternalFeatures.Add(ClickedFeature); _pointsOverlay.Layers.Add(_pointsLayer); Map1.Refresh(); }