This project has moved and is read-only. For the latest updates, please go here.

How to get the point information?

Feb 7, 2012 at 8:29 AM
Edited Feb 7, 2012 at 8: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.

Feb 7, 2012 at 11: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

Feb 8, 2012 at 3:46 AM

Many thanks FObermaier