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

            ShapefileSource dataSource = new ShapefileSource("SampleData/countries-900913.shp");

            dataSource.Open();
            feature1 = dataSource.GetFeatureById("1", RequireColumnsType.None);
            feature2 = dataSource.GetFeatureById("10", RequireColumnsType.None);

            MemoryLayer highlightLayer = new MemoryLayer();

            highlightLayer.Features.Add(feature1);
            highlightLayer.Features.Add(feature2);
            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D")));
            Map1.AddStaticLayers("HighlightOverlay", highlightLayer);

            MemoryLayer resultLayer = new MemoryLayer {
                Name = "ResultLayer"
            };

            resultLayer.Styles.Add(new SymbolStyle(SymbolType.Circle, GeoColor.FromHtml("#99FF5722"), GeoColors.White));
            resultLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#00BCD4"), 4));
            Map1.AddDynamicLayers("ResultOverlay", resultLayer);

            Map1.ZoomTo(GeoBound.CreateToInclude(new[] { feature1, feature2 }));
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            ShapefileSource dataSource = new ShapefileSource("SampleData/countries-900913.shp");

            dataSource.Open();
            highlightFeature = dataSource.GetFeatureById("1", RequireColumnsType.None);

            GeoBound highlightBound = highlightFeature.GetBound();

            highlightBoundFeature = new Feature(highlightBound);

            MemoryLayer highlightLayer = new MemoryLayer()
            {
                Name = "HighlightLayer"
            };

            highlightLayer.Features.Add(highlightFeature);
            highlightLayer.Features.Add(highlightBoundFeature);
            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D")));
            highlightLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#00BCD4"), 4));
            Map1.AddStaticLayers("HighlightOverlay", highlightLayer);

            MemoryLayer resultLayer = new MemoryLayer {
                Name = "ResultLayer"
            };

            resultLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D"), GeoColors.White));
            Map1.AddDynamicLayers("ResultOverlay", resultLayer);

            Map1.ZoomTo(highlightFeature);
        }
Esempio n. 3
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            ShapefileSource dataSource = new ShapefileSource("SampleData/countries-900913.shp");

            dataSource.Open();
            highlightFeature = dataSource.GetFeatureById("1", RequireColumnsType.None);

            MemoryLayer highlightLayer = new MemoryLayer();

            highlightLayer.Features.Add(highlightFeature);
            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D")));
            Map1.AddStaticLayers("HighlightOverlay", highlightLayer);

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

            ShapefileSource dataSource  = new ShapefileSource("SampleData/countries-900913.shp");
            Feature         tempFeature = dataSource.GetFeatureById("1", RequireColumnsType.None);

            MemoryLayer memoryLayer = new MemoryLayer {
                Name = "ResultLayer"
            };

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

            LayerOverlay layerOverlay = new LayerOverlay();

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

            Map1.ZoomTo(tempFeature);
        }