private void WpfMap_Loaded(object sender, RoutedEventArgs e) { Map1.MapUnit = GeographyUnit.DecimalDegree; ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer("../../sampledata/data/countries02.shp"); layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1; layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; LayerOverlay overlay = new LayerOverlay(); overlay.Layers.Add("world", layer); Map1.MapClick += new System.EventHandler(Map1_MapClick); PopupOverlay popupOverlay = new PopupOverlay(); Map1.Overlays.Add("WMK", overlay); Map1.Overlays.Add("POPUP", popupOverlay); InMemoryFeatureLayer highlightLayer = new InMemoryFeatureLayer(); highlightLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Yellow); highlightLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; overlay.Layers.Add("highlight", highlightLayer); Map1.Refresh(); } void Map1_MapClick(object sender, MapClickWpfMapEventArgs e) { ShapeFileFeatureLayer shapeLayer = (Map1.Overlays["WMK"] as LayerOverlay).Layers["world"] as ShapeFileFeatureLayer; InMemoryFeatureLayer highlightLayer = (Map1.Overlays["WMK"] as LayerOverlay).Layers["highlight"] as InMemoryFeatureLayer; shapeLayer.Open(); Collection features = shapeLayer.QueryTools.GetFeaturesContaining(e.WorldLocation, ReturningColumnsType.AllColumns); highlightLayer.InternalFeatures.Clear(); if (features.Count > 0) { highlightLayer.InternalFeatures.Add(features[0]); PopupOverlay overlay = Map1.Overlays["POPUP"] as PopupOverlay; overlay.Popups.Clear(); overlay.Popups.Add(new Popup(e.WorldLocation) { Content = features[0].ColumnValues["CNTRY_NAME"] }); Map1.Refresh(); } }