how to add marker click event

Topics: SharpMap Project, SharpMap v0.9 / v1.x, SharpMap v2.0, WinForms Controls
Oct 14, 2010 at 7:39 AM


I was checking some example code, and I found that we have created map click event not makrer click event , I am getting maker defalut image on map .

Please let me know how i can check if marker is clicked or not.

I want to have marker click event.


Oct 14, 2010 at 9:41 AM

Hi Team,

is anyone done this earlier?

Please let me know I need it very urgently.



Oct 14, 2010 at 12:29 PM


Hello Vivek,

although I have not done this, it should work this way.

  • after map is refreshed, perform ExecuteIntersectionQuery on the Marker layer with the bounding box of the current map.
  • assuming you don't have to many markers place some image controls on your map using map.WorldToImage() function, set featuredatarow as tag property.
  • register click event for each of these imagecontrols and then you can handle that to show a balloon tip with the contents of the featuredatarow.

Hth FObermaier

Oct 14, 2010 at 1:39 PM

Hi FObermaier,

Anyhow thanks for the infomation.

I am still struggling with this.

I will share the code if i will be able to do.. :)

but strange nobody done this till now.


Oct 15, 2010 at 8:37 AM

Hi FObermaier,

I am still working on it.

I want to convert  map clicked x, y point to lat and lon.

Do you have any code exmaple.