Android Question OSMdroid - marker overlay click event(s)

Discussion in 'Android Questions' started by Tony Tetley, Apr 14, 2015.

  1. Tony Tetley

    Tony Tetley Member Licensed 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
     
  2. MaFu

    MaFu Well-Known Member Licensed 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.
     
    Tony Tetley likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice