Exemplo n.º 1
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            ShapefileLayer sectionLayer = new ShapefileLayer("SampleData/sections-900913.shp");

            sectionLayer.Styles.Add(new FillStyle(GeoColors.Transparent, GeoColor.FromHtml("#99FAB04D"), 1));
            Map1.AddStaticLayers("SectionOverlay", sectionLayer);

            GeoBound sectionBound = sectionLayer.GetBound();
            GeoBound queryArea    = (GeoBound)sectionBound.Clone();

            queryArea.ScaleDown(60);

            MemoryLayer queryAreaLayer = new MemoryLayer {
                Name = "QueryAreaLayer"
            };

            queryAreaLayer.Styles.Add(new FillStyle(GeoColors.Transparent, GeoColor.FromHtml("#9900BCD4"), 4));
            queryAreaLayer.Features.Add(new Feature(queryArea));
            Map1.AddStaticLayers("SectionOverlay", queryAreaLayer);

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

            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#66FFFF00"), GeoColors.White));
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            Map1.ZoomTo(sectionLayer.GetBound());
        }
Exemplo n.º 2
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);

            GeoBound tempBound = highlightFeature.GetBound();

            tempBound.ScaleDown(20);
            crossLineFeature = new Feature(new GeoLine(tempBound.GetVertices().Skip(1)));

            MemoryLayer highlightLayer = new MemoryLayer();

            highlightLayer.Features.Add(highlightFeature);
            highlightLayer.Features.Add(crossLineFeature);
            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 SymbolStyle(SymbolType.Circle, GeoColor.FromHtml("#99FF5722"), GeoColors.White));
            Map1.AddDynamicLayers("ResultOverlay", resultLayer);

            Map1.ZoomTo(highlightFeature);
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
        private GeoEllipse CreateEllipse()
        {
            GeoBound bound = (GeoBound)Map1.CurrentBound.Clone();

            bound.ScaleDown(40);
            GeoEllipse ellipse = new GeoEllipse(bound);

            //// use this to create ellipse by center, width and height.
            //GeoEllipse ellipse = new GeoEllipse(bound.GetCentroid(), bound.Width, bound.Height);

            return(ellipse);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Handles the Loaded event of the Map1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            ShapefileLayer lineLayer = new ShapefileLayer("SampleData/streets-900913.shp");

            lineLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#55FAB04D"), 1));
            Map1.AddStaticLayers("LineOverlay", lineLayer);

            GeoBound bound = lineLayer.GetBound();

            bound.ScaleDown(90);
            Map1.ZoomTo(bound);
        }