private void WpfMap_Loaded(object sender, RoutedEventArgs e) { wpfMap1.MapUnit = GeographyUnit.DecimalDegree; wpfMap1.CurrentExtent = new RectangleShape(-133.2515625, 89.2484375, 126.9046875, -88.290625); wpfMap1.Refresh(); } private void addFirstPostion(object sender, RoutedEventArgs e) { Vertex FirstPosition=new Vertex(0,0); wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Add(new Feature(FirstPosition)); wpfMap1.TrackOverlay.Refresh(); } private void addSecondPositon(object sender, RoutedEventArgs e) { Vertex secondPostion = new Vertex(0, 10); PointShape firstPostion = (wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures[0].GetShape() as PointShape); LineShape lineshape = new LineShape(); lineshape.Vertices.Add(new Vertex(firstPostion.X, firstPostion.Y)); lineshape.Vertices.Add(secondPostion); wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear(); wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Add(new Feature(lineshape)); wpfMap1.TrackOverlay.Refresh(); } private void addThridPosition(object sender, RoutedEventArgs e) { Vertex thridPostion = new Vertex(10, 10); LineShape lineshape = (wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures[0].GetShape() as LineShape); PolygonShape polygonShape = new PolygonShape(); polygonShape.OuterRing.Vertices.Add(lineshape.Vertices[0]); polygonShape.OuterRing.Vertices.Add(lineshape.Vertices[1]); polygonShape.OuterRing.Vertices.Add(thridPostion); polygonShape.OuterRing.Vertices.Add(lineshape.Vertices[0]); wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear(); wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Add(new Feature(polygonShape)); wpfMap1.TrackOverlay.Refresh(); } private void addMorePostion(object sender, RoutedEventArgs e) { Vertex MyPosition = new Vertex(40, -10); PolygonShape Polygon = new PolygonShape(); Polygon = (wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures[0].GetShape() as PolygonShape); List listForInsertingVertex = new List(Polygon.OuterRing.Vertices); listForInsertingVertex.RemoveAt(listForInsertingVertex.Count - 1); listForInsertingVertex.Insert(0, MyPosition); listForInsertingVertex.Add(MyPosition); Polygon.OuterRing.Vertices.Clear(); foreach (Vertex vertex in listForInsertingVertex) { Polygon.OuterRing.Vertices.Add(vertex); } wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures[0].WellKnownBinary = Polygon.GetWellKnownBinary(); wpfMap1.TrackOverlay.Refresh(); }