示例#1
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            GeoBound bound  = new GeoBound(2171997.6512, 8356849.2669, 3515687.9933, 11097616.86);
            GeoPoint center = bound.GetCentroid();
            double   x1     = bound.MinX + bound.Width * .25;
            double   y      = center.Y;
            double   x2     = bound.MaxX - bound.Width * .25;
            double   radius = bound.Width * 3 / 8;

            feature1 = new Feature(new GeoEllipse(new GeoPoint(x1, y), radius));
            feature2 = new Feature(new GeoEllipse(new GeoPoint(x2, y), radius));

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

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

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

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

            Map1.ZoomTo(bound);
        }
        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);
        }
示例#3
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            GeoLine greatCircle = CreateGreatCircle();

            MemoryLayer baselineLayer = new MemoryLayer {
                Name = "BaseLineLayer"
            };

            baselineLayer.Styles.Add(new LineStyle(GeoColors.White, 8));
            baselineLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#88FAB04D"), 4));
            baselineLayer.Features.Add(new Feature(greatCircle));
            Map1.AddStaticLayers(baselineLayer);

            Stream airplaneIconStream = Application.GetResourceStream(new Uri("/SlimGis.WpfSamples;component/Images/airplane.png", UriKind.RelativeOrAbsolute)).Stream;

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

            highlightLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#9903A9F4"), 4));
            highlightLayer.Styles.Add(new IconStyle(new GeoImage(airplaneIconStream))
            {
                AspectRatio = 0.6667
            });
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            GeoBound bound = baselineLayer.GetBound();

            bound.ScaleUp(25);
            Map1.ZoomTo(bound);
        }
示例#4
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());
        }
        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 }));
        }
示例#6
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

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

            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D"), GeoColors.White, 4));
            highlightLayer.Styles.Add(new LineStyle(GeoColors.White, 8));
            highlightLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#88FAB04D"), 4));
            highlightLayer.Styles.Add(new SymbolStyle(SymbolType.Circle, GeoColor.FromHtml("#55FAB04D"), GeoColors.White, 4));
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            Map1.ZoomTo(new GeoBound(2171997.6512, 8356849.2669, 3515687.9933, 11097616.86));
        }
示例#7
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

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

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

            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D"), GeoColors.White, 4));
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            Map1.ZoomTo(new GeoBound(2171997.6512, 8356849.2669, 3515687.9933, 11097616.86));
        }
        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);
            transformingFeature = highlightFeature.Clone();

            MemoryLayer highlightLayer = new MemoryLayer();

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

            Map1.ZoomTo(highlightFeature);
        }
示例#9
0
        private void FindClosestPoint(MapMouseMoveEventArgs e)
        {
            MemoryLayer closetPointLayer = Map1.FindLayer <MemoryLayer>("ClosetPointLayer");

            if (closetPointLayer == null)
            {
                closetPointLayer = new MemoryLayer {
                    Name = "ClosetPointLayer"
                };
                closetPointLayer.Styles.Add(new SymbolStyle(SymbolType.Circle, GeoColor.FromHtml("#AA3F8CB4"), GeoColors.White));
                Map1.AddDynamicLayers("ClosestPointOverlay", closetPointLayer);
            }

            GeoPoint closestPoint = highlightFeature.Geometry.GetClosestPointTo(new GeoPoint(e.WorldCoordinate));

            closetPointLayer.Features.Clear();
            if (closestPoint != null)
            {
                closetPointLayer.Features.Add(new Feature(closestPoint));
                Map1.Refresh("ClosestPointOverlay");
            }
        }
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            dataLayer = new ShapefileLayer("SampleData/sections-900913.shp");
            dataLayer.Styles.Add(new FillStyle(GeoColors.Transparent, GeoColor.FromHtml("#99FAB04D"), 1));
            Map1.AddStaticLayers(dataLayer);

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

            highlightLayer.Columns.Add(new FeatureColumn("Area", UnifiedColumnType.Text));
            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#66FFFF00"), GeoColors.White));

            LabelStyle areaLabelStyle = new LabelStyle("Area", new GeoFont(), GeoColor.FromHtml("#111111"), GeoColors.White);

            highlightLayer.Styles.Add(areaLabelStyle);
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            Map1.ZoomTo(new GeoBound(-10111509.577, 4582117.8006, -10099064.6735, 4598828.7496));
        }
示例#11
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

            dataLayer = new ShapefileLayer("SampleData/streets-900913.shp");
            dataLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#55FAB04D"), 4));
            Map1.AddStaticLayers(dataLayer);

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

            highlightLayer.Columns.Add(new FeatureColumn("Distance", UnifiedColumnType.Text));
            highlightLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#8800BCD4"), 8));

            LabelStyle distanceLabelStyle = new LabelStyle("Distance", new GeoFont(), GeoColor.FromHtml("#111111"), GeoColors.White);

            distanceLabelStyle.LineSegmentRatio = 100;
            highlightLayer.Styles.Add(distanceLabelStyle);
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            Map1.ZoomTo(new GeoBound(-10880446.205, 3540612.6137, -10879623.9531, 3541519.945));
        }
示例#12
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();
            GeoBound currentBound = new GeoBound(2171997.6512, 8356849.2669, 3515687.9933, 11097616.86);

            MemoryLayer baselineLayer = new MemoryLayer {
                Name = "BaseLineLayer"
            };

            baselineLayer.Styles.Add(new LineStyle(GeoColors.White, 8));
            baselineLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#88FAB04D"), 4));
            baselineLayer.Features.Add(CreateLineFeature(currentBound));
            Map1.AddStaticLayers(baselineLayer);

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

            highlightLayer.Styles.Add(new LineStyle(GeoColor.FromHtml("#9903A9F4"), 4));
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            Map1.ZoomTo(currentBound);
        }
示例#13
0
        private void Map1_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeoUnit.Meter;
            Map1.UseOpenStreetMapAsBaseMap();

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

            GeoPen outlinePen = new GeoPen(GeoColor.FromHtml("#00BCD4"), 2)
            {
                DashPattern = new float[] { 4, 4 }
            };

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

            highlightLayer.Styles.Add(new FillStyle(GeoColor.FromHtml("#55FAB04D")));
            highlightLayer.Styles.Add(new LineStyle(outlinePen));
            highlightLayer.Styles.Add(new SymbolStyle(SymbolType.Circle, GeoColor.FromHtml("#99FF5722"), GeoColors.White));
            Map1.AddDynamicLayers("HighlightOverlay", highlightLayer);

            Map1.ZoomTo(new GeoBound(2171997.6512, 8356849.2669, 3515687.9933, 11097616.86));
        }