private void DisplayMap_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay(); winformsMap1.Overlays.Add(worldMapKitDesktopOverlay); Random random = new Random(); InMemoryFeatureLayer inmLayer = new InMemoryFeatureLayer(); inmLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; inmLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1; inmLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; ////add waypoints 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)); ////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(wayPoint1)); inmLayer.InternalFeatures.Add(new Feature(wayPoint2)); inmLayer.InternalFeatures.Add(new Feature(wayPoint3)); inmLayer.InternalFeatures.Add(new Feature(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(); }