Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

New Post: adding points to a new layer

$
0
0
OK, apparently the issue was setting the map projection after it was loaded from the webprovider. Here is what works:

ProjectionInfo wgs = this.map1.Projection;
        // The FeatureSet starts with no data; be sure to set it to the point featuretype
        this.dbMarkers = new FeatureSet(FeatureType.Point);
        this.dbMarkers.Projection = wgs;

        // The MapPointLayer controls the drawing of the marker features
        this.dbMarkerLayer = new MapPointLayer(this.dbMarkers);
        this.dbMarkerLayer.Projection = wgs;

        // The Symbolizer controls what the points look like
        this.dbMarkerLayer.Symbolizer = new PointSymbolizer(Color.Blue, DotSpatial.Symbology.PointShape.Star, 15);

        // A drawing layer draws on top of data layers, but is still georeferenced.
        this.map1.MapFrame.DrawingLayers.Add(this.dbMarkerLayer);

        //add feature set to map
        this.map1.Layers.Add(this.dbMarkerLayer);
        this.dbMarkerLayer.LegendText = "Points From Sqlite";
Now I can plot as many points as I wish. I can select or deselect the layer and I can change the map provider.

Viewing all articles
Browse latest Browse all 3973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>