private void DisplayMap_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay(); PolygonShape Polygon1 = new PolygonShape("Polygon((-10 10,10 10,10 -10,-10 -10,-10 10))"); Feature PolygonFeature1 = new Feature(Polygon1); PolygonFeature1.ColumnValues.Add("TotalSelected", "1"); Marker marker1 = new Marker(Polygon1.GetBoundingBox().GetCenterPoint()) { Image = Properties.Resources.AQUA, Width = 20, Height = 34, YOffset = -17 }; PolygonShape Polygon2 = new PolygonShape("Polygon((-10 30,10 30,10 20,-10 20,-10 30))"); Feature PolygonFeature2 = new Feature(Polygon2); PolygonFeature2.ColumnValues.Add("TotalSelected", "2"); Marker marker2 = new Marker(Polygon2.GetBoundingBox().GetCenterPoint()) { Image = Properties.Resources.AQUA, Width = 20, Height = 34, YOffset = -17 }; SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay(); markerOverlay.MapControl = winformsMap1; markerOverlay.Markers.Add(marker1); markerOverlay.Markers.Add(marker2); InMemoryFeatureLayer DetailLayer = new InMemoryFeatureLayer(); DetailLayer.Open(); DetailLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; DetailLayer.Columns.Add(new FeatureSourceColumn("TotalSelected")); DetailLayer.InternalFeatures.Add(PolygonFeature1); DetailLayer.InternalFeatures.Add(PolygonFeature2); Collection GeoColors = new Collection(); GeoColors.Add(GeoColor.SimpleColors.LightRed); GeoColors.Add(GeoColor.SimpleColors.LightGreen); Collection polygonIndexes = new Collection(); polygonIndexes.Add(0); polygonIndexes.Add(2); ClassBreakStyle Breaks = new ClassBreakStyle("TotalSelected"); for (int j = 0; j < 2; j++) { AreaStyle aStyle = new AreaStyle(new GeoPen(GeoColor.StandardColors.Black), new GeoSolidBrush( GeoColors[j])); Breaks.ClassBreaks.Add(new ClassBreak(polygonIndexes[j], aStyle)); } DetailLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(Breaks); DetailLayer.Close(); LayerOverlay layerOverlay = new LayerOverlay(); layerOverlay.Layers.Add("DetailLayer",DetailLayer); winformsMap1.Overlays.Add(worldMapKitDesktopOverlay); winformsMap1.Overlays.Add("layerOverlay", layerOverlay); winformsMap1.Overlays.Add("MarkerOverlay", markerOverlay); winformsMap1.CurrentExtent = new RectangleShape(-139.2, 92.4, 120.9, -93.2); winformsMap1.Refresh(); }