protected override void DrawCore(WinformsMap winformsMap)
        {
            LayerOverlay layerOverlay = null;

            if (!LoadingFromShapeFile)
            {
                layerOverlay = new LayerOverlay();

                foreach (Layer layer in Layers)
                {
                    layerOverlay.Layers.Add(layer);
                }
            }
            else
            {
                ShapeFileFeatureLayer.BuildIndexFile(ShapePathFileName, BuildIndexMode.DoNotRebuild);
                ShapeFileFeatureLayer shapeFileFeatureLayer = new ShapeFileFeatureLayer(ShapePathFileName);
                shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(102, 0, 0, 255), GeoColor.FromArgb(255, 0, 0, 255), 2);
                shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(102, 0, 0, 255), 2, true);
                shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(102, 0, 0, 255), 12);
                shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

                layerOverlay = new LayerOverlay();
                layerOverlay.Layers.Add(shapeFileFeatureLayer);
                layerOverlay.Layers.Add(OutputFeatureLayer);
                winformsMap.CurrentExtent = GetBoundingBox();
            }

            winformsMap.Overlays.Clear();
            winformsMap.Overlays.Add(layerOverlay);
            winformsMap.Refresh();
        }
Beispiel #2
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.DecimalDegree;
            winformsMap1.CurrentExtent = new RectangleShape(-97.7583, 30.2714, -97.7444, 30.2632);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.StandardColors.LightGoldenrodYellow);

            ShapeFileFeatureLayer streetLayer = new ShapeFileFeatureLayer(@"..\..\Data\Streets.shp");

            streetLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.LocalRoad1;
            streetLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add("StreetLayer", streetLayer);
            winformsMap1.Overlays.Add("LayerOverlay", layerOverlay);

            //InMemoryFeature to show the selected feature (the feature clicked on).
            InMemoryFeatureLayer selectLayer = new InMemoryFeatureLayer();

            selectLayer.Open();
            selectLayer.Columns.Add(new FeatureSourceColumn("FENAME"));
            selectLayer.Close();
            selectLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(150, GeoColor.StandardColors.Red), 10, true);
            selectLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle    = TextStyles.LocalRoad1("FENAME");
            selectLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay selectOverlay = new LayerOverlay();

            selectOverlay.Layers.Add("SelectLayer", selectLayer);
            winformsMap1.Overlays.Add("SelectOverlay", selectOverlay);

            winformsMap1.Refresh();
        }
Beispiel #3
0
    private void sampleFileListBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        CadFeatureLayer layer = new CadFeatureLayer(@"..\..\Data\" + sampleFileListBox.SelectedItem.ToString());

        // Render the data using embedded style in the CAD file
        if (radioButtonEmbeddedStyle.Checked)
        {
            layer.StylingType = CadStylingType.EmbeddedStyling;
        }
        // Render the data using a customized style
        else
        {
            layer.StylingType = CadStylingType.StandardStyling;
            layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.Black, 2, true);
            layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Blue, 8);
            layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Yellow);
            layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        }

        layerOverlay.Layers.Clear();
        layerOverlay.Layers.Add(layer);

        Cursor = Cursors.WaitCursor;
        layer.Open();
        fullExtent = layer.GetBoundingBox();
        winformsMap1.CurrentExtent = fullExtent;
        winformsMap1.Refresh();
        Cursor = Cursors.Default;
    }
        private void GetDynamicDistanceBetweenTwoPoints_Load(object sender, EventArgs e)
        {
            LayerOverlay baseOverlay = new LayerOverlay();
            WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();

            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);

            LayerOverlay lineOverlay = new LayerOverlay();

            winformsMap1.Overlays.Add("LineOverlay", lineOverlay);

            InMemoryFeatureLayer shadowLayer = new InMemoryFeatureLayer();

            shadowLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(150, GeoColor.FromHtml("#F2ABB1")), 2, LineDashStyle.Dash, true);
            shadowLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            lineOverlay.Layers.Add("Shadow", shadowLayer);

            InMemoryFeatureLayer shapeLayer = new InMemoryFeatureLayer();

            shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.FromHtml("#ED775B"), 10, GeoColor.FromHtml("#CA5B48"));
            shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.FromHtml("#CA5B48"), 3, true);
            shapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            lineOverlay.Layers.Add("Shape", shapeLayer);

            winformsMap1.CurrentExtent = new RectangleShape(-132, 55, -70, 20);
            winformsMap1.Refresh();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.DisplayMapView);

            TinyGeoFeatureLayer tinyGeoFeatureLayer = new TinyGeoFeatureLayer(SampleHelper.GetDataPath(@"Frisco/Frisco.tgeo"));

            tinyGeoFeatureLayer.ZoomLevelSet.ZoomLevel11.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.DarkGray, 1F, false);
            tinyGeoFeatureLayer.ZoomLevelSet.ZoomLevel11.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level14;
            tinyGeoFeatureLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 3F, GeoColor.StandardColors.DarkGray, 5F, true);
            tinyGeoFeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 8F, GeoColor.StandardColors.DarkGray, 10F, true);
            tinyGeoFeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle    = TextStyles.CreateSimpleTextStyle("[fedirp] [fename] [fetype] [fedirs]", "Arial", 10f, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, 0, -1);
            tinyGeoFeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle.SuppressPartialLabels = true;
            tinyGeoFeatureLayer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            tinyGeoFeatureLayer.Open();

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(tinyGeoFeatureLayer);

            WorldMapKitOverlay worldMapKitOverlay = new WorldMapKitOverlay();

            androidMap         = FindViewById <MapView>(Resource.Id.androidmap);
            androidMap.MapUnit = GeographyUnit.DecimalDegree;
            androidMap.Overlays.Add(worldMapKitOverlay);
            androidMap.Overlays.Add(layerOverlay);
            androidMap.CurrentExtent = tinyGeoFeatureLayer.GetBoundingBox();

            SampleViewHelper.InitializeInstruction(this, FindViewById <RelativeLayout>(Resource.Id.MainLayout), GetType());
        }
Beispiel #6
0
        protected override void OnGottenLayers(GottenLayersLayerPluginEventArgs e)
        {
            base.OnGottenLayers(e);
            foreach (var tobinBasFeatureLayer in e.Layers.OfType <TobinBasFeatureLayer>())
            {
                CompositeStyle compositeStyle = new CompositeStyle();
                compositeStyle.Name = tobinBasFeatureLayer.Name;
                AreaStyle areaStyle = AreaStyles.CreateSimpleAreaStyle(new GeoColor(0, GeoColor.SimpleColors.Black), new GeoColor(250, GeoColor.SimpleColors.Black), 1);
                areaStyle.Name = "Area Style";
                LineStyle lineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.Black, 0.5f, false);
                lineStyle.Name = "Line Style";
                PointStyle pointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Green, 3);
                pointStyle.Name = "Point Style";

                compositeStyle.Styles.Add(areaStyle);
                compositeStyle.Styles.Add(lineStyle);
                compositeStyle.Styles.Add(pointStyle);

                foreach (var zoomLevel in tobinBasFeatureLayer.ZoomLevelSet.CustomZoomLevels)
                {
                    zoomLevel.CustomStyles.Clear();
                    zoomLevel.CustomStyles.Add(compositeStyle);
                }
            }

            BuildIndexAdapter adapter = new TobinBasBuildIndexAdapter(this);

            adapter.BuildIndex(e.Layers.OfType <FeatureLayer>());
        }
Beispiel #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.DisplayASimpleMap);

            ShapeFileFeatureLayer txwatFeatureLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath(@"Frisco/TXwat.shp"));

            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.DefaultAreaStyle.FillSolidBrush.Color = GeoColor.FromArgb(255, 153, 179, 204);
            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("LandName", "Arial", 9, DrawingFontStyles.Italic, GeoColor.StandardColors.Navy);
            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.DefaultTextStyle.SuppressPartialLabels = true;
            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            ShapeFileFeatureLayer txlkaA40FeatureLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath(@"Frisco/TXlkaA40.shp"));

            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel14.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.DarkGray, 1F, false);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 3F, GeoColor.StandardColors.DarkGray, 5F, true);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 8F, GeoColor.StandardColors.DarkGray, 10F, true);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("[fedirp] [fename] [fetype] [fedirs]", "Arial", 10f, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, 0, -1);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle.SuppressPartialLabels = true;
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            txlkaA40FeatureLayer.DrawingMarginPercentage = 80;

            ShapeFileFeatureLayer txlkaA20FeatureLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath(@"Frisco/TXlkaA20.shp"));

            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(255, 255, 255, 128), 6, GeoColor.StandardColors.LightGray, 9, true);
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(255, 255, 255, 128), 9, GeoColor.StandardColors.LightGray, 12, true);
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("[fedirp] [fename] [fetype] [fedirs]", "Arial", 12, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, 0, -1);
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle.SuppressPartialLabels = true;
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            WorldMapKitOverlay worldMapKitOverlay = new WorldMapKitOverlay();

            Marker thinkGeoMarker = new Marker(BaseContext);

            thinkGeoMarker.Position = new PointShape(-96.809523, 33.128675);
            thinkGeoMarker.YOffset  = -(int)(22 * ThinkGeo.MapSuite.Android.Resources.DisplayMetrics.Density);
            thinkGeoMarker.SetImageBitmap(BitmapFactory.DecodeResource(ThinkGeo.MapSuite.Android.Resources, Resource.Drawable.Pin));
            thinkGeoMarker.Click += ThinkGeoMarkerClick;

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(txlkaA40FeatureLayer);
            layerOverlay.Layers.Add(txwatFeatureLayer);
            layerOverlay.Layers.Add(txlkaA20FeatureLayer);

            MarkerOverlay markerOverlay = new MarkerOverlay();

            markerOverlay.Markers.Add(thinkGeoMarker);

            androidMap               = FindViewById <MapView>(Resource.Id.androidmap);
            androidMap.MapUnit       = GeographyUnit.DecimalDegree;
            androidMap.CurrentExtent = new RectangleShape(-96.8172, 33.1299, -96.8050, 33.1226);
            androidMap.Overlays.Add(worldMapKitOverlay);
            androidMap.Overlays.Add(layerOverlay);
            androidMap.Overlays.Add(markerOverlay);
            androidMap.Overlays.Add("PopupOverlay", new PopupOverlay());

            SampleViewHelper.InitializeInstruction(this, FindViewById <RelativeLayout>(Resource.Id.MainLayout), GetType());
        }
Beispiel #8
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            label1.Text = "Drag vertex of the polygon. Hold Shift key and release mouse button to have the vertex snapping to the line.";

            winformsMap1.MapUnit       = GeographyUnit.DecimalDegree;
            winformsMap1.CurrentExtent = new RectangleShape(-97.755, 30.319, -97.7266, 30.3018);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));

            //Displays the World Map Kit as a background.
            ThinkGeo.MapSuite.DesktopEdition.WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new ThinkGeo.MapSuite.DesktopEdition.WorldMapKitWmsDesktopOverlay();
            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);

            string       fileName1 = @"..\..\data\polygon.txt";
            StreamReader sr1       = new StreamReader(fileName1);

            string       fileName2 = @"..\..\data\line.txt";
            StreamReader sr2       = new StreamReader(fileName2);

            //DragtInteractiveOverlay for setting the PointStyles of the control points and dragged points.
            DragInteractiveOverlayAdvanced dragInteractiveOverlay = new DragInteractiveOverlayAdvanced();

            dragInteractiveOverlay.EditShapesLayer.InternalFeatures.Add("Polygon", new Feature(BaseShape.CreateShapeFromWellKnownData(sr1.ReadLine())));

            //Sets the PointStyle for the non dragged control points.
            dragInteractiveOverlay.ControlPointStyle = new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(GeoColor.StandardColors.PaleGoldenrod), new GeoPen(GeoColor.StandardColors.Black), 8);
            //Sets the PointStyle for the dragged control points.
            dragInteractiveOverlay.DraggedControlPointStyle = new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(GeoColor.StandardColors.Green), new GeoPen(GeoColor.StandardColors.DarkGreen, 2), 10);
            //Sets the PointStyle for the dragged control points when shit key pressed.
            dragInteractiveOverlay.DraggedControlPointStyleWithShiftKey = new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(GeoColor.StandardColors.Red), new GeoPen(GeoColor.StandardColors.Orange, 2), 10);
            //LineShape snapping feature.
            LineShape snappingLineShape = (LineShape)BaseShape.CreateShapeFromWellKnownData(sr2.ReadLine());

            dragInteractiveOverlay.SnappingFeature = new Feature(snappingLineShape);

            dragInteractiveOverlay.CanAddVertex    = false;
            dragInteractiveOverlay.CanDrag         = false;
            dragInteractiveOverlay.CanRemoveVertex = false;
            dragInteractiveOverlay.CanResize       = false;
            dragInteractiveOverlay.CanRotate       = false;
            dragInteractiveOverlay.CalculateAllControlPoints();

            winformsMap1.EditOverlay = dragInteractiveOverlay;

            //Regular InMemoryFeatureLayer for displaying line snapping feature.
            InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();

            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Red, 4, true);
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            inMemoryFeatureLayer.InternalFeatures.Add(new Feature(snappingLineShape));

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(inMemoryFeatureLayer);
            winformsMap1.Overlays.Add(layerOverlay);

            winformsMap1.Refresh();
        }
        public RadiusMearsureTrackInteractiveOverlay(DistanceUnit distanceUnit, GeographyUnit mapUnit)
        {
            this.mapUnit      = mapUnit;
            this.distanceUnit = distanceUnit;

            TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.DarkBlue, 8);
            TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.White, 3, true);
            TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(80, GeoColor.SimpleColors.LightGreen), GeoColor.SimpleColors.White, 2);
            TrackShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        }
        protected TopologyTestCase(string name)
        {
            this.name          = name;
            outputFeatureLayer = new InMemoryFeatureLayer();
            outputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(new GeoColor(180, GeoColor.StandardColors.Red), GeoColor.StandardColors.Black);
            outputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(new GeoColor(180, GeoColor.StandardColors.Red), 2, true);
            outputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(new GeoColor(180, GeoColor.StandardColors.Red), 12);
            outputFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            layers = new Collection <InMemoryFeatureLayer>();
            layers.Add(OutputFeatureLayer);
        }
Beispiel #11
0
        protected override void DrawCore(IEnumerable <Feature> features, GeoCanvas canvas, System.Collections.ObjectModel.Collection <SimpleCandidate> labelsInThisLayer, System.Collections.ObjectModel.Collection <SimpleCandidate> labelsInAllLayers)
        {
            LineShape     drawingLineShape;
            PointShape    linePoint;
            LineBaseShape lineShape;
            LineStyle     lineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.Black, 1f, false);
            LineShape     tangentLineShape;
            ScreenPointF  screenPointF;
            double        angle, decDistance = 0;

            foreach (Feature feature in features)
            {
                drawingLineShape = (LineShape)feature.GetShape();

                while (!(decDistance > drawingLineShape.GetLength(GeographyUnit.Meter, DistanceUnit.Kilometer)))
                {
                    linePoint = drawingLineShape.GetPointOnALine(StartingPoint.FirstPoint, decDistance, GeographyUnit.Meter, DistanceUnit.Kilometer);

                    tangentLineShape = GetTangentForLinePosition(drawingLineShape, decDistance);
                    angle            = GetAngleFromTwoVertices(tangentLineShape.Vertices[0], tangentLineShape.Vertices[1]);

                    angle += 90.0;
                    if (angle >= 360.0)
                    {
                        angle = angle - 180;
                    }

                    screenPointF = ExtentHelper.ToScreenCoordinate(canvas.CurrentWorldExtent, linePoint, (float)canvas.Width, (float)canvas.Height);

                    canvas.DrawText("    " + decDistance.ToString(), new GeoFont("Arial", 12, DrawingFontStyles.Bold),
                                    new GeoSolidBrush(GeoColor.StandardColors.Black), new GeoPen(GeoColor.StandardColors.White),
                                    new ScreenPointF[] { screenPointF }, DrawingLevel.LabelLevel, 0f, 0f, Convert.ToSingle(angle));

                    double dblTranslateAngle = GetOrthogonalFromVertex(tangentLineShape.Vertices[0], tangentLineShape.Vertices[1], Side.Right);

                    double worldDist = ExtentHelper.GetWorldDistanceBetweenTwoScreenPoints
                                           (canvas.CurrentWorldExtent, 0, 0, 5, 0, canvas.Width, canvas.Height, GeographyUnit.Meter, DistanceUnit.Meter);

                    PointShape pointShape2 = (PointShape)BaseShape.TranslateByDegree
                                                 (linePoint, worldDist, dblTranslateAngle, GeographyUnit.Meter, DistanceUnit.Meter);

                    lineShape = new ThinkGeo.MapSuite.Core.LineShape(new ThinkGeo.MapSuite.Core.Vertex[] {
                        new ThinkGeo.MapSuite.Core.Vertex(linePoint),
                        new ThinkGeo.MapSuite.Core.Vertex(pointShape2)
                    });

                    lineStyle.Draw(new BaseShape[] { lineShape }, canvas, labelsInThisLayer, labelsInAllLayers);
                    decDistance += 0.1;
                }
                lineStyle.Draw(features, canvas, labelsInThisLayer, labelsInAllLayers);
            }
        }
        protected OneInputLayerTopologyTestCase(string name)
            : base(name)
        {
            inputFeatureLayer = new InMemoryFeatureLayer();
            inputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(102, 0, 0, 255), GeoColor.FromArgb(255, 0, 0, 255), 2);
            inputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(102, 0, 0, 255), 2, true);
            inputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(102, 0, 0, 255), 12);
            inputFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            Layers = new Collection <InMemoryFeatureLayer>();
            Layers.Add(inputFeatureLayer);
            Layers.Add(OutputFeatureLayer);
        }
        private LayerOverlay CreateHighlightLayerOverlay(Feature feature)
        {
            LayerOverlay         highlightOverlay     = new LayerOverlay();
            InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();

            //GeoHatchBrush fillBrush = new GeoHatchBrush(GeoHatchStyle.Cross, GeoColor.FromArgb(100, 0, 255, 0));
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateHatchStyle(GeoHatchStyle.BackwardDiagonal, GeoColor.FromArgb(150, 254, 255, 39), GeoColor.StandardColors.Transparent);
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(50, GeoColor.StandardColors.Green), 3, false);
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            inMemoryFeatureLayer.InternalFeatures.Add(feature);

            highlightOverlay.Layers.Add(inMemoryFeatureLayer);
            return(highlightOverlay);
        }
Beispiel #14
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.DecimalDegree;
            winformsMap1.CurrentExtent = new RectangleShape(-96.8531, 33.1084, -96.8461, 33.106);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));

            //Displays the World Map Kit as a background.
            ThinkGeo.MapSuite.DesktopEdition.WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new ThinkGeo.MapSuite.DesktopEdition.WorldMapKitWmsDesktopOverlay();
            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);

            LineShape lineShape = new LineShape();

            lineShape.Vertices.Add(new Vertex(-96.8511, 33.1089));
            lineShape.Vertices.Add(new Vertex(-96.8504, 33.108));
            lineShape.Vertices.Add(new Vertex(-96.85, 33.1077));
            lineShape.Vertices.Add(new Vertex(-96.8498, 33.1076));
            lineShape.Vertices.Add(new Vertex(-96.8482, 33.1076));

            LineShape lineShape2 = new LineShape();

            lineShape2.Vertices.Add(new Vertex(-96.8497, 33.1084));
            lineShape2.Vertices.Add(new Vertex(-96.8506, 33.1072));

            //MapShapeLayer to display the three features (line to split, splitting line and intersection point).
            MapShapeLayer mapShapeLayer = new MapShapeLayer();

            //For the line to split.
            MapShape lineMapShape1 = new MapShape(new Feature(lineShape));

            lineMapShape1.ZoomLevels.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Green, 2, true);
            lineMapShape1.ZoomLevels.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            mapShapeLayer.MapShapes.Add("Line1", lineMapShape1);

            //For the splitting line.
            MapShape lineMapShape2 = new MapShape(new Feature(lineShape2));

            lineMapShape2.ZoomLevels.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Red, 1, true);
            lineMapShape2.ZoomLevels.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            mapShapeLayer.MapShapes.Add("Line2", lineMapShape2);

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(mapShapeLayer);

            winformsMap1.Overlays.Add(layerOverlay);

            winformsMap1.Refresh();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.DisplayASimpleMap);

            ValueStyle pointStyle = new ValueStyle();

            pointStyle.ColumnName = "IsWayPoint";
            pointStyle.ValueItems.Add(new ValueItem("0", PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Red, 4)));
            pointStyle.ValueItems.Add(new ValueItem("1", PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Green, 8)));

            LineStyle roadstyle = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.Black, 1, true);

            TextStyle labelStyle = TextStyles.CreateSimpleTextStyle("name", "Arial", 8, DrawingFontStyles.Bold, GeoColor.SimpleColors.Black);

            labelStyle.PointPlacement  = PointPlacement.UpperCenter;
            labelStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping;
            labelStyle.YOffsetInPixel  = 8;

            GpxFeatureLayer gpxFeatureLayer = new GpxFeatureLayer(SampleHelper.GetDataPath(@"Gpx/afoxboro.gpx"));

            gpxFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(pointStyle);
            gpxFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(roadstyle);
            gpxFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            gpxFeatureLayer.Open();

            GpxFeatureLayer gpxTextLayer = new GpxFeatureLayer(SampleHelper.GetDataPath(@"Gpx/afoxboro.gpx"));

            gpxTextLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(labelStyle);
            gpxTextLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(gpxFeatureLayer);
            layerOverlay.Layers.Add(gpxTextLayer);

            WorldMapKitOverlay worldMapKitOverlay = new WorldMapKitOverlay();

            androidMap = FindViewById <MapView>(Resource.Id.androidmap);
            androidMap.Overlays.Add(worldMapKitOverlay);
            androidMap.Overlays.Add(layerOverlay);
            androidMap.CurrentExtent = gpxFeatureLayer.GetBoundingBox();
            androidMap.MapUnit       = GeographyUnit.DecimalDegree;

            SampleViewHelper.InitializeInstruction(this, FindViewById <RelativeLayout>(Resource.Id.MainLayout), GetType());
        }
Beispiel #16
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.DisplayASimpleMap);

            ShapeFileFeatureLayer txwatFeatureLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath(@"Frisco/TXwat.shp"));

            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.DefaultAreaStyle.FillSolidBrush.Color = GeoColor.FromArgb(255, 153, 179, 204);
            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("LandName", "Arial", 9, DrawingFontStyles.Italic, GeoColor.StandardColors.Navy);
            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.DefaultTextStyle.SuppressPartialLabels = true;
            txwatFeatureLayer.ZoomLevelSet.ZoomLevel12.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            ShapeFileFeatureLayer txlkaA40FeatureLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath(@"Frisco/TXlkaA40.shp"));

            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel14.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.DarkGray, 1F, false);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 3F, GeoColor.StandardColors.DarkGray, 5F, true);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 8F, GeoColor.StandardColors.DarkGray, 10F, true);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("[fedirp] [fename] [fetype] [fedirs]", "Arial", 10f, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, 0, -1);
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle.SuppressPartialLabels = true;
            txlkaA40FeatureLayer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            txlkaA40FeatureLayer.DrawingMarginPercentage = 80;

            ShapeFileFeatureLayer txlkaA20FeatureLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath(@"Frisco/TXlkaA20.shp"));

            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(255, 255, 255, 128), 6, GeoColor.StandardColors.LightGray, 9, true);
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(255, 255, 255, 128), 9, GeoColor.StandardColors.LightGray, 12, true);
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("[fedirp] [fename] [fetype] [fedirs]", "Arial", 12, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, 0, -1);
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle.SuppressPartialLabels = true;
            txlkaA20FeatureLayer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            markerOverlay = new MarkerOverlay();
            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add("TXwat", txwatFeatureLayer);
            layerOverlay.Layers.Add("TXlkaA20", txlkaA20FeatureLayer);
            layerOverlay.Layers.Add("TXlkaA40", txlkaA40FeatureLayer);

            androidMap               = FindViewById <MapView>(Resource.Id.androidmap);
            androidMap.MapUnit       = GeographyUnit.DecimalDegree;
            androidMap.CurrentExtent = new RectangleShape(-96.8172, 33.1299, -96.8050, 33.1226);
            androidMap.Overlays.Add("markerOverlay", markerOverlay);
            androidMap.Overlays.Add(layerOverlay);
            androidMap.MapSingleTap += AndroidMap_MapSingleTap;

            SampleViewHelper.InitializeInstruction(this, FindViewById <RelativeLayout>(Resource.Id.MainLayout), GetType());
        }
Beispiel #17
0
        public LinesMustBeLargerThanClusterToleranceTopologyTestCase(string name)
            : base(name)
        {
            TestCaseInputType = TestCaseInputType.Line;
            InputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle   = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(70, 0, 0, 255), 2, true);
            InputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle   = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(20, 0, 0, 255), GeoColor.FromArgb(255, 0, 0, 255), 2);
            OutputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle  = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(200, GeoColor.StandardColors.Green), 2, true);
            OutputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle  = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(102, 0, 0, 255), GeoColor.FromArgb(255, 0, 0, 255), 2);
            OutputFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Transparent, 10);

            assistantLayer = new InMemoryFeatureLayer();
            assistantLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(20, 255, 255, 255), GeoColor.FromArgb(70, 0, 0, 0));
            assistantLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Red, 5);
            assistantLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            this.Layers.Add(assistantLayer);
        }
        public void AnotherWFS(Map map)
        {
            WfsFeatureLayer wfs = new ThinkGeo.MapSuite.Layers.WfsFeatureLayer("https://demo.boundlessgeo.com/geoserver/wfs", "topp:states");

            wfs.TimeoutInSeconds = 60;
            Proj4Projection proj4Projection = new Proj4Projection(4326, 4326);

            proj4Projection.Open();
            wfs.FeatureSource.Projection = proj4Projection;
            wfs.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.BrightRed, 15, false);
            wfs.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay overlay = map.CustomOverlays["AnotherWFS"] as LayerOverlay;

            overlay.Layers.Clear();
            overlay.Layers.Add(wfs);
        }
Beispiel #19
0
    private void radioButtonStandardStyle_CheckedChanged(object sender, EventArgs e)
    {
        CadFeatureLayer layer = ((CadFeatureLayer)layerOverlay.Layers[0]);

        if (radioButtonStandardStyle.Checked)
        {
            layer.StylingType = CadStylingType.StandardStyling;
            layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Black, 1F, false);
            layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.StandardColors.White, 3.2F, GeoColor.StandardColors.Black, 1F);
            layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 233, 232, 214), GeoColor.FromArgb(255, 118, 138, 69));
            layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        }
        else
        {
            layer.StylingType = CadStylingType.EmbeddedStyling;
        }
        winformsMap1.Refresh();
    }
        private void SetDefaultStyle()
        {
            var defaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(102, 0, 0, 255), 10, GeoColor.FromArgb(100, 0, 0, 255), 2);
            var defaultLineStyle  = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(100, 0, 0, 255), 2, true);
            var defaultAreaStyle  = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(102, GeoColor.FromHtml("#EFFBD6")), GeoColor.FromArgb(255, 0, 0, 255), 2);

            editShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = defaultPointStyle;
            editShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = defaultLineStyle;
            editShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = defaultAreaStyle;
            editShapesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            ValueStyle valueStyle = new ValueStyle();

            valueStyle.ColumnName = existingFeatureColumnName;
            valueStyle.ValueItems.Add(new ValueItem(string.Empty, PointStyles.CreateSimpleSquareStyle(GeoColor.StandardColors.White, 8, GeoColor.StandardColors.Black)));
            valueStyle.ValueItems.Add(new ValueItem(existingFeatureColumnValue, PointStyles.CreateSimpleSquareStyle(GeoColor.StandardColors.Orange, 8, GeoColor.StandardColors.Black)));

            reshapeControlPointsLayer.Open();
            reshapeControlPointsLayer.Columns.Add(new FeatureSourceColumn(existingFeatureColumnName));
            reshapeControlPointsLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle);
            reshapeControlPointsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            associateControlPointsLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = new PointStyle(GetGeoImageFromResource("/ThinkGeo.MapSuite.WpfDesktop.Extension;component/Resources/resize.png"));
            associateControlPointsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            snappingPointsLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(new PeakStyle());
            snappingPointsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            snappingToleranceLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            snappingToleranceLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = new AreaStyle(new GeoPen(GeoColor.SimpleColors.Black, 1));

            var unselectedPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.StandardColors.LightGray, 10, GeoColor.StandardColors.LightGray, 2);
            var unselectedLineStyle  = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.LightGray, 3, true);
            var unselectedAreaStyle  = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(0, GeoColor.FromHtml("#EFFBD6")), GeoColor.StandardColors.LightGray, 3);

            editCandidatesLayer.Open();
            editCandidatesLayer.Columns.Add(new FeatureSourceColumn(existingFeatureColumnName));
            editCandidatesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(unselectedAreaStyle);
            editCandidatesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(unselectedLineStyle);
            editCandidatesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(unselectedPointStyle);
            editCandidatesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle);
            editCandidatesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        }
Beispiel #21
0
        /// <summary>
        /// Returns a ShapeFileFeatureLayer with the region's path shape file.
        /// </summary>
        /// <returns></returns>
        public static ShapeFileFeatureLayer GetRegionPathLayer(Region region)
        {
            if (String.IsNullOrEmpty(region.PathFileName))
            {
                return(null);
            }

            ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(GetPathShapeFileFullPath(region))
            {
                Name = region.IDRegion + "PATH"
            };

            layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColors.GreenYellow, 1, GeoColors.GreenYellow, 0, GeoColors.GreenYellow, 0, false);
            layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            RebuildIndexFile(layer);

            return(layer);
        }
        public RadiusMearsureTrackInteractiveOverlay(DistanceUnit distanceUnit, GeographyUnit mapUnit)
        {
            DistanceUnit = distanceUnit;
            MapUnit      = mapUnit;

            textBlock            = new TextBlock();
            textBlock.Visibility = Visibility.Collapsed;
            OverlayCanvas.Children.Add(textBlock);

            PolygonTrackMode = PolygonTrackMode.LineWithFill;
            RenderMode       = RenderMode.DrawingVisual;

            areaStyle  = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(80, GeoColor.SimpleColors.LightGreen), GeoColor.SimpleColors.White, 2);
            pointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.DarkBlue, 8);
            lineStyle  = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.White, 3, true);

            SetStylesForInMemoryFeatureLayer(TrackShapeLayer);
            SetStylesForInMemoryFeatureLayer(TrackShapesInProcessLayer);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.DisplayASimpleMap);

            ShapeFileFeatureLayer txlka40FeatureLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath(@"Frisco/TXlkaA40.shp"));

            txlka40FeatureLayer.ZoomLevelSet.ZoomLevel14.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.DarkGray, 1F, false);
            txlka40FeatureLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 3F, GeoColor.StandardColors.DarkGray, 5F, true);
            txlka40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 8F, GeoColor.StandardColors.DarkGray, 10F, true);
            txlka40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("[fedirp] [fename] [fetype] [fedirs]", "Arial", 10f, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, 0, -1);
            txlka40FeatureLayer.ZoomLevelSet.ZoomLevel16.DefaultTextStyle.SuppressPartialLabels = true;
            txlka40FeatureLayer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            txlka40FeatureLayer.DrawingMarginPercentage = 80;

            InMemoryFeatureLayer highlightLayer = new InMemoryFeatureLayer();

            highlightLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.White, 9.2F, GeoColor.StandardColors.DarkGray, 12.2F, true);
            highlightLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.InnerPen.Brush = new GeoSolidBrush(GeoColor.FromArgb(150, GeoColor.SimpleColors.Blue));
            highlightLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel             = ApplyUntilZoomLevel.Level20;

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add("TXlkaA40", txlka40FeatureLayer);

            LayerOverlay highlightOverlay = new LayerOverlay();

            highlightOverlay.Layers.Add("HighlightLayer", highlightLayer);

            androidMap               = FindViewById <MapView>(Resource.Id.androidmap);
            androidMap.MapUnit       = GeographyUnit.DecimalDegree;
            androidMap.CurrentExtent = new RectangleShape(-96.8172, 33.1299, -96.8050, 33.1226);
            androidMap.Overlays.Add("RoadOverlay", layerOverlay);
            androidMap.Overlays.Add("HighlightOverlay", highlightOverlay);
            androidMap.MapSingleTap += AndroidMap_MapSingleTap;

            messageLabel = new TextView(this);
            SampleViewHelper.InitializeInstruction(this, FindViewById <RelativeLayout>(Resource.Id.MainLayout), GetType(), new Collection <View>()
            {
                messageLabel
            });
        }
Beispiel #24
0
        private void WpfMap_Loaded(object sender, RoutedEventArgs e)
        {
            Map1.MapUnit = GeographyUnit.DecimalDegree;
            Map1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 172, 205, 226));

            LayerOverlay layerOverlay = new LayerOverlay();

            Map1.Overlays.Add("worldmapkit", layerOverlay);

            featureLayer = new ShapeFileFeatureLayer(@"..\..\data\Road_Network.shp");
            featureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.LocalRoad3;
            featureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            layerOverlay.Layers.Add(featureLayer);

            ShapeFileFeatureLayer pointsLayer = new ShapeFileFeatureLayer(@"..\..\data\Points.shp");

            pointsLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.Capital1;
            pointsLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle    = TextStyles.Capital1("ID");
            pointsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            layerOverlay.Layers.Add(pointsLayer);

            routeResultLayer = new InMemoryFeatureLayer();
            routeResultLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.Blue, 3, true);
            routeResultLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            layerOverlay.Layers.Add(routeResultLayer);

            pointsLayer.Open();
            Collection <Feature> features = pointsLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns);

            foreach (Feature feature in features)
            {
                Points.Add(feature.ColumnValues["ID"], feature.GetShape() as PointShape);
            }
            pointsLayer.Close();

            featureLayer.Open();
            Map1.CurrentExtent = featureLayer.GetBoundingBox();
            featureLayer.Close();

            Map1.Refresh();
        }
        public void WFS(Map map)
        {
            //("https://demo.boundlessgeo.com/geoserver/wfs", "medford:bikelanes")
            var wfs = new WfsFeatureLayer("https://geoservices.informatievlaanderen.be/overdrachtdiensten/GRB/wfs", "GRB:WLAS");

            wfs.TimeoutInSeconds = 600;

            Proj4Projection proj4Projection = new Proj4Projection(31370, 4326);

            proj4Projection.Open();
            wfs.FeatureSource.Projection = proj4Projection;
            wfs.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.BrightRed, 15, false);
            wfs.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;


            //do all events
            LayerOverlay overlay = map.CustomOverlays["SomeWFS"] as LayerOverlay;

            overlay.Layers.Clear();
            overlay.Layers.Add(wfs);
        }
Beispiel #26
0
        private void btnSplitLine_Click(object sender, EventArgs e)
        {
            LayerOverlay  layerOverLay  = (LayerOverlay)winformsMap1.Overlays[1];
            MapShapeLayer mapShapeLayer = (MapShapeLayer)layerOverLay.Layers[0];

            LineShape lineShape  = (LineShape)mapShapeLayer.MapShapes["Line1"].Feature.GetShape();
            LineShape lineShape2 = (LineShape)mapShapeLayer.MapShapes["Line2"].Feature.GetShape();

            //Gets the crossing MultipointShape with the PointShape that will be used to calculate the two split lines.
            MultipointShape multipointShape = lineShape.GetCrossing(lineShape2);

            //Uses the GetLineOnLine (Dynamic Segmentation) to get the two split lines from the intersection point.
            LineShape splitLineShape1 = (LineShape)lineShape.GetLineOnALine(StartingPoint.FirstPoint, multipointShape.Points[0]);
            LineShape splitLineShape2 = (LineShape)lineShape.GetLineOnALine(StartingPoint.LastPoint, multipointShape.Points[0]);

            //Displays the two split lines with different colors to distinguish them.
            MapShape splitMapShape1 = new MapShape(new Feature(splitLineShape1));

            splitMapShape1.ZoomLevels.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Orange, 3, true);
            splitMapShape1.ZoomLevels.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            mapShapeLayer.MapShapes.Add("SplitLine1", splitMapShape1);

            MapShape splitMapShape2 = new MapShape(new Feature(splitLineShape2));

            splitMapShape2.ZoomLevels.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Turquoise, 3, true);
            splitMapShape2.ZoomLevels.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            mapShapeLayer.MapShapes.Add("SplitLine2", splitMapShape2);

            //Displays the intersection point as a reference.
            MapShape pointMapShape = new MapShape(new Feature(multipointShape.Points[0]));

            pointMapShape.ZoomLevels.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle,
                                                                                                        GeoColor.StandardColors.Red, GeoColor.StandardColors.Black, 1, 9);
            pointMapShape.ZoomLevels.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            mapShapeLayer.MapShapes.Add("Point", pointMapShape);

            winformsMap1.Refresh(layerOverLay);

            btnSplitLine.Enabled = false;
        }
Beispiel #27
0
        private void AddQueryResultLayers(Map Map1)
        {
            // define the track layer.
            LayerOverlay trackResultOverlay = new LayerOverlay("TrackShapeOverlay");

            trackResultOverlay.IsVisibleInOverlaySwitcher = false;
            trackResultOverlay.TileType = TileType.SingleTile;
            Map1.CustomOverlays.Add(trackResultOverlay);

            InMemoryFeatureLayer trackResultLayer = new InMemoryFeatureLayer();

            trackResultLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(80, GeoColor.SimpleColors.LightGreen), GeoColor.SimpleColors.White, 2);
            trackResultLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.Orange, 2, true);
            trackResultLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Orange, 10);
            trackResultLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            trackResultOverlay.Layers.Add("TrackShapeLayer", trackResultLayer);

            // define the marker and highlight layer for markers.
            LayerOverlay queryResultMarkerOverlay = new LayerOverlay("QueryResultMarkerOverlay");

            queryResultMarkerOverlay.IsBaseOverlay = false;
            queryResultMarkerOverlay.IsVisibleInOverlaySwitcher = false;
            queryResultMarkerOverlay.TileType = TileType.SingleTile;
            Map1.CustomOverlays.Add(queryResultMarkerOverlay);

            InMemoryFeatureLayer markerMemoryLayer = new InMemoryFeatureLayer();

            markerMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Gold, 8, GeoColor.SimpleColors.Orange, 1);
            markerMemoryLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            queryResultMarkerOverlay.Layers.Add("MarkerMemoryLayer", markerMemoryLayer);

            InMemoryFeatureLayer markerMemoryHighLightLayer = new InMemoryFeatureLayer();
            PointStyle           highLightStyle             = new PointStyle();

            highLightStyle.CustomPointStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(50, GeoColor.SimpleColors.Blue), 20, GeoColor.SimpleColors.LightBlue, 1));
            highLightStyle.CustomPointStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.LightBlue, 9, GeoColor.SimpleColors.Blue, 1));
            markerMemoryHighLightLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = highLightStyle;
            markerMemoryHighLightLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            queryResultMarkerOverlay.Layers.Add("MarkerMemoryHighLightLayer", markerMemoryHighLightLayer);
        }
Beispiel #28
0
        private static void SetStyle(InMemoryFeatureLayer layer)
        {
            PointStyle pointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(100, GeoColor.StandardColors.White), 12, GeoColor.FromArgb(200, GeoColor.StandardColors.Black), 1);

            LineStyle lineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(255, 0, 0, 255), 2, true);

            lineStyle.OuterPen.LineJoin  = DrawingLineJoin.Round;
            lineStyle.InnerPen.LineJoin  = DrawingLineJoin.Round;
            lineStyle.CenterPen.LineJoin = DrawingLineJoin.Round;

            AreaStyle areaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(102, 0, 0, 255), GeoColor.FromArgb(255, 0, 0, 255), 2);

            areaStyle.OutlinePen.LineJoin = DrawingLineJoin.Round;

            layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = null;
            layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = null;
            layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = null;
            layer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle    = null;

            layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(pointStyle);
            layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(lineStyle);
            layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(areaStyle);
        }
Beispiel #29
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Sets the correct map unit and the extent of the map.
            wpfMap1.MapUnit       = GeographyUnit.Meter;
            wpfMap1.CurrentExtent = new RectangleShape(-13086298.60, 7339062.72, -8111177.75, 2853137.62);
            wpfMap1.Background    = new SolidColorBrush(Color.FromRgb(148, 196, 243));

            GoogleMapsOverlay googleMapsOverlay = new GoogleMapsOverlay();

            wpfMap1.Overlays.Add(googleMapsOverlay);

            //Custom projection that will allow to project from State Plane Central North Texas to Spherical Mercator while applying a rotation.
            customRotationProjection = new Projections.CustomRotationProjection(Proj4Projection.GetEsriParametersString(102738),
                                                                                Proj4Projection.GetGoogleMapParametersString());

            ShapeFileFeatureLayer streetLayer = new ShapeFileFeatureLayer(@"../../data/Streets_subset.shp");

            streetLayer.FeatureSource.Projection = customRotationProjection;
            streetLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle
                                                                        (GeoColor.StandardColors.Red, 3, GeoColor.FromArgb(255, GeoColor.StandardColors.Black), 5, true);
            streetLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add("StreetLayer", streetLayer);
            wpfMap1.Overlays.Add("StreetOverlay", layerOverlay);

            //Sets the pivot point to be the center of the layer.
            streetLayer.Open();
            customRotationProjection.PivotVertex = new Vertex(streetLayer.GetBoundingBox().GetCenterPoint());
            streetLayer.Close();

            customRotationProjection.Angle = 20;

            wpfMap1.Refresh();
        }
Beispiel #30
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.DecimalDegree;
            winformsMap1.CurrentExtent = new RectangleShape(-88.0309, 42.2772, -88.0036, 42.2609);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));

            //Displays the World Map Kit as a background.
            WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();

            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);

            ManagedProj4Projection proj4 = new ManagedProj4Projection();

            proj4.InternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(26916);
            proj4.ExternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(4326);

            ShapeFileFeatureLayer layer1 = new ShapeFileFeatureLayer(@"..\..\data\lake_streets_utm16.shp");

            layer1.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.DarkGreen, 4, true);
            layer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            layer1.FeatureSource.Projection = proj4;

            ShapeFileFeatureLayer layer2 = new ShapeFileFeatureLayer(@"..\..\data\lake_poly.shp");

            layer2.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(150, GeoColor.StandardColors.Green), GeoColor.StandardColors.Black);
            layer2.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(layer1);
            layerOverlay.Layers.Add(layer2);
            winformsMap1.Overlays.Add(layerOverlay);

            InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();

            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.StandardColors.Red, 10);
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            PointShape pointShape = new PointShape(-88.0168, 42.2688);

            inMemoryFeatureLayer.InternalFeatures.Add(new Feature(pointShape));

            InMemoryFeatureLayer selectInMemoryFeatureLayer = new InMemoryFeatureLayer();

            selectInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Yellow);
            selectInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle    = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Yellow, 3, true);
            selectInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            double meterDistance = 300;

            layer1.Open();
            // This method works fine with Map Suite Assemblies 4.5.54.0 or later.
            Collection <Feature> withinFeatures1 = layer1.QueryTools.GetFeaturesWithinDistanceOf(pointShape, winformsMap1.MapUnit, DistanceUnit.Meter, meterDistance, ReturningColumnsType.AllColumns);

            layer1.Close();
            foreach (Feature withinFeature1 in withinFeatures1)
            {
                selectInMemoryFeatureLayer.InternalFeatures.Add(withinFeature1);
            }

            layer2.Open();
            Collection <Feature> withinFeatures2 = layer2.QueryTools.GetFeaturesWithinDistanceOf(pointShape, winformsMap1.MapUnit, DistanceUnit.Meter, meterDistance, ReturningColumnsType.AllColumns);

            layer2.Close();
            foreach (Feature withinFeature2 in withinFeatures2)
            {
                selectInMemoryFeatureLayer.InternalFeatures.Add(withinFeature2);
            }

            LayerOverlay dynamicOverlay = new LayerOverlay();

            dynamicOverlay.Layers.Add(inMemoryFeatureLayer);
            dynamicOverlay.Layers.Add(selectInMemoryFeatureLayer);
            winformsMap1.Overlays.Add(dynamicOverlay);

            ScaleBarAdornmentLayer scaleBarAdornmentLayer = new ScaleBarAdornmentLayer();

            scaleBarAdornmentLayer.UnitFamily = UnitSystem.Metric;
            scaleBarAdornmentLayer.Location   = AdornmentLocation.LowerLeft;
            winformsMap1.AdornmentOverlay.Layers.Add(scaleBarAdornmentLayer);

            winformsMap1.Refresh();
        }