Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: Adding Marker/Pushpin to selected Polygon

$
0
0
I guess the best way to do it is to generated in-memory point shapefile with centers (centroids) of polygons and then to set icons like in the example. Here is some quick code how to do it (check naming for API members in documentation):
Shapefile sfNew = new Shapefile();
sfNew.Create("", ShpType.POINT);   // no filename = in-memory
 for(int i = 0; i < i sf.numShapes; i++) {
     Point pnt = sf.get_Shape(i).Centroid();
     Shape shp = new Shape();
     shp.Create(ShpType.POINT);
     shp.AddPoint(pnt);
     sfNew.EditAddShape(pnt);
}
// apply icons for sfNew

Viewing all articles
Browse latest Browse all 2341

Trending Articles



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