private void SelectFeatures_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\Countries02.shp"); worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green)); worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; LayerOverlay staticOverlay = new LayerOverlay(); InMemoryFeatureLayer inmLayer = new InMemoryFeatureLayer(); inmLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1; staticOverlay.Layers.Add("WorldLayer", worldLayer); staticOverlay.Layers.Add("inmLayer", inmLayer); winformsMap1.Overlays.Add(staticOverlay); winformsMap1.MapClick += new EventHandler(winformsMap1_MapClick); winformsMap1.EditOverlay = new MyEditOverlay(); winformsMap1.CurrentExtent = new RectangleShape(-139.2, 92.4, 120.9, -93.2); winformsMap1.Refresh(); } void winformsMap1_MapClick(object sender, MapClickWinformsMapEventArgs e) { FeatureLayer worldLayer = winformsMap1.FindFeatureLayer("WorldLayer"); worldLayer.Open(); Collection selectedFeatures = worldLayer.QueryTools.GetFeaturesContaining(e.WorldLocation, new string[1] { "CNTRY_NAME" }); worldLayer.Close(); winformsMap1.EditOverlay.EditShapesLayer.Open(); winformsMap1.EditOverlay.EditShapesLayer.Clear(); foreach (Feature feature in selectedFeatures) { winformsMap1.EditOverlay.EditShapesLayer.InternalFeatures.Add(feature); } winformsMap1.EditOverlay.CalculateAllControlPoints(); winformsMap1.Refresh(); } class MyEditOverlay : EditInteractiveOverlay { protected override void DrawCore(GeoCanvas canvas) { Collection labelsInAllLayers = new Collection(); EditShapesLayer.Open(); EditShapesLayer.Draw(canvas, labelsInAllLayers); } }