How to get the point information?

Editor
Feb 7, 2012 at 7:29 AM
Edited Feb 7, 2012 at 7:41 AM

Hi All!

I am using Sharpmap v0.9. I want to select a point or line in my map (using Mapbox) based on mouse click event on my winform. When I click point or line , it should select the point or line and show information by popup. Help me plz. Thanks.

Coordinator
Feb 7, 2012 at 10:21 AM

Basically you need to transform the point you are clicking at to map coordinates (MapToWorld(...)), use that Point and perform layer.ExecuteIntersectionQuery(point, ...).

If you use MapBox or MapImage, it is even easier. Set the QueryLayerIndex to the apropriate value, set the ActiveTool to MapTools.Query and click on the map control. To show your popup, you need to handle MapQueried event.

Hth FObermaier

Editor
Feb 8, 2012 at 2:46 AM

Many thanks FObermaier