code for creating labels on shapefiles

Mar 13, 2013 at 7:19 AM
Hi ,
I am new to mapwingis , iam developing an application in which i can add shape file and when click on point it will display the information
Mar 14, 2013 at 9:15 PM
You will need a way to get the shapes that are in the vicinity of the mouse cursor and then once that is established get the attributes of that shape or shapes.
Main docs here: http://mapwingis.codeplex.com/documentation
Maybe in the map_MouseMoveEvent you can put a buffer around the cursor position http://www.mapwindow.org/documentation/mapwingis4.8/class_ax_map.html#a7f9ea56b66c63f474bb996f28da6fd1e then set extents to that position plus a buffer. http://www.mapwindow.org/documentation/mapwingis4.8/class_ax_map.html#a3c2dbda8b40414767867ffc2c0bcaa75
then see what shapes are in that extent http://www.mapwindow.org/documentation/mapwingis4.8/group__shapefile__selection.html#ga67c36f870d2db98b2c8515f43ef62ac3

or you can do it on the MouseUp event. Either way the links above also have samples.

AGP
Coordinator
Mar 15, 2013 at 1:26 PM
If you mean by clicking on the point selecting the point you can use sf.get_ShapeSelected(): http://www.mapwindow.org/documentation/mapwingis4.8/group__shapefile__selection.html#ga491bfd09dea9f90391771971bfab6c7d to get the selected point and read the attribute data and display it.
You can also use the mouse_clickEvent to select shapes around the clickpoint using sf.SelectShapes(): http://www.mapwindow.org/documentation/mapwingis4.8/group__shapefile__selection.html#ga67c36f870d2db98b2c8515f43ef62ac3

Paul