Polygon Touch detection Google Map API V2

后端 未结 6 2082
小蘑菇
小蘑菇 2020-11-28 11:22

I\'m trying to figure out how best to do this, I have a map with one Polygon drawn on it. Since it doesn\'t seem as though the Google Maps API V2 has a touch de

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 11:59

    Just for consistency - onMapClick is not called when user taps on a polygon (or other overlay), and it's mentioned in javadoc.

    I made a workaround to intercept taps events before MapFragment handles them, and project point to map coordinates and check if the point is inside any polygon, as suggested in other answer.

    See more details here

提交回复
热议问题