Android Question OSMdroid - marker overlay click event(s)

Tony Tetley

Member
Licensed User
Longtime User
The OSMdroid lib is really great! But I have a problem with multiple markers. If there are two markers very close together on the map I am getting click events for both of them on one touch. Is there a way to prevent or ignore the second click?

Thanks,
Tony
 

MaFu

Well-Known Member
Licensed User
Longtime User
Create a global long variable and set it to 0 on app start.
In your click event get the current time with DateTime.Now and compare it with the variable value. If the difference is smaller than a second ignore the event. Otherwise set the variable to the current time and continue with the event code.
 
Upvote 0
Top