private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            LayerOverlay staticOverlay = new LayerOverlay {
                Name = "Static Overlay"
            };

            staticOverlay.Layers.Add(new OpenStreetMapLayer());
            Map1.Overlays.Add(staticOverlay);

            ShapefileLayer dynamicLayer = new ShapefileLayer("SampleData/countries-900913.shp");

            dynamicLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D"), GeoColors.White));

            LayerOverlay dynamicOverlay = new LayerOverlay {
                Name = "Dynamic Overlay"
            };

            dynamicOverlay.Layers.Add(dynamicLayer);
            Map1.Overlays.Add(dynamicOverlay);

            Map1.ZoomToFullBound();

            Collection <OverlayViewModel> viewModel = new Collection <OverlayViewModel>();

            viewModel.Add(new OverlayViewModel(staticOverlay));
            viewModel.Add(new OverlayViewModel(dynamicOverlay));
            OverlayListGrid.DataContext = viewModel;
        }
Ejemplo n.º 2
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();
            Map1.ZoomToFullBound();

            TrackModeOptions.ItemsSource = Enum.GetValues(typeof(TrackMode));
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.AddStaticLayers("OpenStreetMap", new OpenStreetMapLayer());
            Map1.AddStaticLayers("StamenMap - Watercolor", new StamenMapLayer(StamenMapType.Terrain));
            Map1.ZoomToFullBound();

            UpdateClips();
            Map1.SizeChanged += Map1_SizeChanged;
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Degree;

            ShapefileLayer featureLayer = new ShapefileLayer("SampleData/countries-wgs84.shp");

            featureLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#FAB04D"), GeoColors.White));
            Map1.AddStaticLayers("countries-wgs84", featureLayer);

            Map1.ZoomToFullBound();
        }
Ejemplo n.º 5
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            GeoBound bound = (GeoBound)Map1.MaxBound.Clone();

            bound.ScaleDown(60);
            Map1.Behaviors.EditBehavior.EditingFeatures.Add(new Feature(bound));

            Map1.ZoomToFullBound();
        }
Ejemplo n.º 6
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            LayerOverlay staticOverlay = new LayerOverlay {
                Name = "Static Overlay"
            };

            staticOverlay.Layers.Add(new OpenStreetMapLayer());
            Map1.Overlays.Add(staticOverlay);

            Map1.ZoomToFullBound();
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            Map1.UseOpenStreetMapAsBaseMap();

            ShapefileLayer shapefileLayer = new ShapefileLayer("AppData/countries-900913.shp");

            shapefileLayer.UseRandomStyle(120);
            Map1.AddStaticLayers("Dynamic Layers", shapefileLayer);

            Map1.ZoomToFullBound();
        }
Ejemplo n.º 8
0
        public Form1()
        {
            InitializeComponent();

            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            ShapefileLayer shapefileLayer = new ShapefileLayer("AppData/countries-900913.shp");

            shapefileLayer.UseRandomStyle(120);
            Map1.AddStaticLayers("Dynamic Layers", shapefileLayer);

            Map1.ZoomToFullBound();
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            GeoImage      image         = new GeoImage(@"SampleData/bing-aerial-900913.png");
            GeoSize       size          = image.GetSize();
            GeoImageLayer geoImageLayer = new GeoImageLayer(image, new WorldFile(GeoCommonHelper.GetMaxBound(GeoUnit.Meter), (float)size.Width, (float)size.Height));

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(geoImageLayer);
            Map1.Overlays.Add(layerOverlay);
            Map1.ZoomToFullBound();
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            BingMapsLayer bingMapsLayer = new BingMapsLayer(BingMapsType.Road, "AswP3q2unPpwB7h5xK-DbPvN_2ZbjQqGeQ18dp3HfSn3IKon4dLM3-IDX3jswTMd");
            LayerOverlay  layerOverlay  = new LayerOverlay();

            layerOverlay.Layers.Add(bingMapsLayer);
            Map1.Overlays.Add(layerOverlay);

            // We can also use the code below to add a google maps to our map.
            // Map1.UseBingMapsAsBaseMap(BingMapsType.Road, "Your BingMaps Key");

            Map1.ZoomToFullBound();
        }
Ejemplo n.º 11
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            BingMapsLayer bingMapsLayer = new BingMapsLayer(BingMapsType.Road, "AhDBjJalvtRXvYe6BsKuj2DwHT9Atlkas7HNVU7rDvoUvIu0_L_GVtSc8y9gNP61");
            LayerOverlay  layerOverlay  = new LayerOverlay();

            layerOverlay.Layers.Add(bingMapsLayer);
            Map1.Overlays.Add(layerOverlay);

            // We can also use the code below to add a google maps to our map.
            // Map1.UseBingMapsAsBaseMap(BingMapsType.Road, "Your BingMaps Key");

            Map1.ZoomToFullBound();
        }
Ejemplo n.º 12
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            StamenMapLayer stamenMapLayer = new StamenMapLayer();

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(stamenMapLayer);
            Map1.Overlays.Add(layerOverlay);

            // We can also use the code below to add a stamen maps to our map.
            // Map1.UseStamenMapAsBaseMap(StamenMapType.Toner);

            Map1.ZoomToFullBound();
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            OpenStreetMapLayer openStreetMapLayer = new OpenStreetMapLayer();

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(openStreetMapLayer);
            Map1.Overlays.Add(layerOverlay);

            // We can also use the code below to add a google maps to our map.
            // Map1.UseOpenStreetMapAsBaseMap();

            Map1.ZoomToFullBound();
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            ShapefileLayer shapefileLayer = new ShapefileLayer("SampleData/countries-900913.shp");

            shapefileLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D"), GeoColors.White));

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(shapefileLayer);
            Map1.Overlays.Add(layerOverlay);

            Map1.ZoomToFullBound();
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            GoogleMapsLayer googleMapsLayer = new GoogleMapsLayer(GoogleMapsType.RoadMap, "AIzaSyC2CYaFRRi-Caf24Lq_2xu5seA3EzLWKv0");

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(googleMapsLayer);
            Map1.Overlays.Add(layerOverlay);

            // We can also use the code below to add a google maps to our map.
            // Map1.UseGoogleMapsAsBaseMap(GoogleMapsType.RoadMap, "Your api key", "Your client id");

            Map1.ZoomToFullBound();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (Map1.MapUnit == GeoUnit.Meter)
            {
                return;
            }

            Map1.MapUnit = GeoUnit.Meter;
            FeatureLayer     featureLayer = Map1.FindLayer <ShapefileLayer>("countries-wgs84");
            SpatialReference srsSource    = SpatialReferences.GetWgs84();
            SpatialReference srsTarget    = SpatialReferences.GetSphericalMercator();

            featureLayer.Source.Projection = new Proj4Projection(srsSource, srsTarget);

            Map1.Overlays["countries-wgs84"].Invalidate();
            Map1.ZoomToFullBound();
        }
Ejemplo n.º 17
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            WmsLayer wmsLayer = new WmsLayer("https://ahocevar.com/geoserver/wms");

            wmsLayer.Name = "Wms";
            wmsLayer.Crs  = "EPSG:900913";
            wmsLayer.Layers.Add("topp:states");
            wmsLayer.Parameters.Add("TILED", "TRUE");

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(wmsLayer);
            Map1.Overlays.Add(layerOverlay);

            Map1.ZoomToFullBound();
        }
Ejemplo n.º 18
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;

            Map1.AddStaticLayers("OpenStreetMap", new OpenStreetMapLayer());
            Map1.AddStaticLayers("StamenMap - Toner", new StamenMapLayer(StamenMapType.Toner));
            Map1.AddStaticLayers("StamenMap - Watercolor", new StamenMapLayer(StamenMapType.Watercolor));

            ShapefileLayer countriesLayer = new ShapefileLayer("SampleData/countries-900913.shp");

            countriesLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#FAB04D"), GeoColors.White));
            Map1.AddStaticLayers("Countries", countriesLayer);

            Map1.Overlays.Skip(1).ForEach(o => o.IsVisible = false);
            Map1.ZoomToFullBound();

            List <OverlayViewModel> viewModel = new List <OverlayViewModel>();

            viewModel.AddRange(Map1.Overlays.Select(o => new OverlayViewModel(o)));
            OverlayListGrid.DataContext = viewModel;
        }
Ejemplo n.º 19
0
 private void Map1_Loaded(object sender, RoutedEventArgs e)
 {
     Map1.MapUnit = GeoUnit.Meter;
     Map1.UseOpenStreetMapAsBaseMap();
     Map1.ZoomToFullBound();
 }