winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay(); winformsMap1.Overlays.Add(worldMapKitDesktopOverlay); Collection columns = new Collection() { new FeatureSourceColumn("LineName") }; InMemoryFeatureLayer inmLayer = new InMemoryFeatureLayer(columns,new Collection()); inmLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(LineStyles.LocalRoad2); inmLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.LocalRoad2("LineName")); inmLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; InMemoryMarkerOverlay markerOverlay = new InMemoryMarkerOverlay(); markerOverlay.MapControl = winformsMap1; markerOverlay.Columns.Add(new FeatureSourceColumn("PointName")); markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Image = Properties.Resources.AQUA; markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Width = 20; markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Height = 34; markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.YOffset = -17; markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.ToolTipText = "This is [#PointName#]."; markerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; winformsMap1.Overlays.Add("MarkerOverlay", markerOverlay); ////add waypoints Random random = new Random(); Vertex wayPoint1 = new Vertex(random.Next(-180, 180), random.Next(-90, 90)); Vertex wayPoint2 = new Vertex(random.Next(-180, 180), random.Next(-90, 90)); Vertex wayPoint3 = new Vertex(random.Next(-180, 180), random.Next(-90, 90)); Feature point1Feature = new Feature(new PointShape(wayPoint1), new Dictionary() { { "PointName", "Point1" } }); Feature point2Feature = new Feature(new PointShape(wayPoint2), new Dictionary() { { "PointName", "Point2" } }); Feature point3Feature = new Feature(new PointShape(wayPoint3), new Dictionary() { { "PointName", "Point3" } }); markerOverlay.FeatureSource.BeginTransaction(); markerOverlay.FeatureSource.AddFeature(point1Feature); markerOverlay.FeatureSource.AddFeature(point2Feature); markerOverlay.FeatureSource.AddFeature(point3Feature); markerOverlay.FeatureSource.CommitTransaction(); ////add lines Collection wayPoints = new Collection(); wayPoints.Add(wayPoint1); wayPoints.Add(wayPoint2); wayPoints.Add(wayPoint3); wayPoints.Add(wayPoint1); LineShape line1 = new LineShape(wayPoints); inmLayer.InternalFeatures.Add(new Feature(line1, new Dictionary() { { "LineName", "Line1" } })); LayerOverlay overlay = new LayerOverlay(); overlay.Layers.Add(inmLayer); winformsMap1.Overlays.Add(overlay); winformsMap1.CurrentExtent = new RectangleShape(-139.2, 92.4, 120.9, -93.2); winformsMap1.Refresh();