This project is read-only.

Adding Marker/Pushpin to selected Polygon

May 6, 2013 at 8:00 AM
Can anyone help me
i want to do something like this --->

but without points
i want to put marker inside a selected Polygon

thanks in advance
May 7, 2013 at 12:01 PM
Edited May 7, 2013 at 12:03 PM
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();
// apply icons for sfNew