private void TrackAndEditShapes_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.CurrentExtent = new RectangleShape(-139.2, 92.4, 120.9, -93.2); winformsMap1.Refresh(); } private void button_Click(object sender, EventArgs e) { Button button = sender as Button; if (button != null) { switch (button.Name) { case "btnTrackNormal": winformsMap1.TrackOverlay.TrackMode = TrackMode.None; break; case "btnTrackLine": winformsMap1.TrackOverlay.TrackMode = TrackMode.Line; break; case "btnTrackEdit": winformsMap1.TrackOverlay.TrackMode = TrackMode.None; MultilineShape multiLines = new MultilineShape(); foreach (Feature feature in winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures) { multiLines.Lines.Add(feature.GetShape() as LineShape); } winformsMap1.EditOverlay.EditShapesLayer.InternalFeatures.Add(new Feature(multiLines)); winformsMap1.EditOverlay.CalculateAllControlPoints(); winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear(); winformsMap1.Refresh(new Overlay[] { winformsMap1.EditOverlay, winformsMap1.TrackOverlay }); break; default: winformsMap1.TrackOverlay.TrackMode = TrackMode.None; break; } } }