Beispiel #1
0
        private void OnAddPointsCommand()
        {
            var points = GetPoints();

            foreach (var point in points)
            {
                GraphicsProvider.Publish(new MapObject(point)
                {
                    LayerId = LayerKeys.Points.ToString()
                });
            }
        }
Beispiel #2
0
        private void OnAddPolygonsCommand()
        {
            var points = GetPoints();

            foreach (var point in points)
            {
                var polygon = GeometryEngine.BufferGeodetic(point, 3, LinearUnits.Kilometers);
                GraphicsProvider.Publish(new MapObject(polygon)
                {
                    LayerId = LayerKeys.Polygon.ToString()
                });
            }
        }
Beispiel #3
0
        private void OnAddPolylinesCommand()
        {
            var points = GetPoints();

            foreach (var point in points)
            {
                var linePoints = new List <MapPoint>();
                for (int i = 0; i < 30; i++)
                {
                    linePoints.AddRange(GeometryEngine.MoveGeodetic(new[] { point }, 500, LinearUnits.Meters,
                                                                    _random.Next(0, 360),
                                                                    AngularUnits.Degrees, GeodeticCurveType.Geodesic));
                }

                var polyLine = new PolylineBuilder(linePoints, SpatialReferences.Wgs84);
                GraphicsProvider.Publish(new MapObject(polyLine.ToGeometry())
                {
                    LayerId = LayerKeys.Polyline.ToString()
                });
            }
        }
Beispiel #4
0
 private void OnClearDataCommand()
 {
     GraphicsProvider.Purge();
 }
Beispiel #5
0
 public MapHost()
 {
     Maps             = new ObservableCollection <MapViewModel>();
     GraphicsProvider = new GraphicsProvider();
 }