Search code examples
androidandroid-mapviewitemizedoverlay

How to inhabilite the onTap area of the item on a mapview?


i have some items on my map.

Some of them, friends, have to show some info on a dialog when the user press on them. And some of them, my current possition, have to show nothing.

i tryed removing all the code of the onTap function of ImtemizedOverlay for my position, but it doesnt works.... why? because if my position is near of a friend, if i try to press on the friend, doesn't happens nothing... ¿why? because my position onTap area it's mixed with the friend onTap area, and when i'm trying to press the onTap of the friend, it's pressing the empty onTap of my possition.

There is a way to solve this?

thanks


Solution

  • The ItemizedOverlay that shows your position should return false from onTap() or don't overwrite this method at all. The map will forward the event to the other overlays in this case.

    When you return true from onTap(), the event will be eaten by this overlay and the other overlays will never be called.