private void DisplayMap_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; ShapeFileFeatureLayer majorCit = new ShapeFileFeatureLayer(@"..\..\sampledata\data\majorcities.shp"); majorCit.Open(); majorCit.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1; majorCit.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; ShapeFileFeatureLayer worldCapitals = new ShapeFileFeatureLayer(@"..\..\sampledata\data\worldcapitals.shp"); worldCapitals.Open(); worldCapitals.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; worldCapitals.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; PointShape pointInMajorCit = majorCit.FeatureSource.GetFeatureById("5", ReturningColumnsType.NoColumns).GetShape() as PointShape; PointShape pointInWorldCapitals = worldCapitals.FeatureSource.GetFeatureById("15", ReturningColumnsType.NoColumns).GetShape() as PointShape; LineShape line = new LineShape(); line.Vertices.Add(new Vertex(pointInMajorCit)); line.Vertices.Add(new Vertex(pointInWorldCapitals)); InMemoryFeatureLayer inmLayer = new InMemoryFeatureLayer(); inmLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1; inmLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayer.InternalFeatures.Add(new Feature(line)); LayerOverlay ov = new LayerOverlay(); ov.Layers.Add(majorCit); ov.Layers.Add(worldCapitals); ov.Layers.Add(inmLayer); winformsMap1.Overlays.Add(ov); winformsMap1.CurrentExtent = new RectangleShape(-180, 90, 180, -90); winformsMap1.Refresh(); }