Beispiel #1
0
        public Map(MapControl.Map passedMap, PolygonDrawer passedDrawer, Location center = null, double zoom = 14)
        {
            // Can't create a new map, so use the existing one
            WPFMap        = passedMap;
            polygonDrawer = passedDrawer;

            WPFMap.ZoomLevel    = zoom;
            WPFMap.MaxZoomLevel = 19; // Any closer and the map starts getting blurry

            // Setup easing function for centering and changing zoom level
            WPFMap.AnimationEasingFunction            = new CubicEase();
            WPFMap.AnimationEasingFunction.EasingMode = EasingMode.EaseInOut;

            // Default center is at MIF
            WPFMap.Center = center ?? new Location(54.675083, 25.273633);

            // Add OSM layer
            WPFMap.MapLayer = MapTileLayer.OpenStreetMapTileLayer;

            // Add map scale marker
            WPFMap.Children.Add(new MapScale
            {
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Bottom
            });

            tempMarker            = new Marker2();
            tempMarker.MouseDown += new MouseButtonEventHandler(OnMarkerClick);

            searchRadius = new RadiusCircle(WPFMap.Center, 0.0);
        }
 public MarketBoundaryDrawingTool(PolygonDrawer passedDrawer)
 {
     polygonDrawer = passedDrawer;
     polygonDrawer.ClearPolygon();
     polygonDrawer.DrawPolygon(new LocationCollection());
 }