Google Maps API v2:如何使标记不可点击?
我的意思是如果我点击标记 OnMarkerClickListener
被调用,所以 OnMapClickListener
没有.即使我设置了 mMap.setOnMarkerClickListener(null);
标记对象仍然屏蔽底层地图和对象的所有点击事件.如何为所有用户交互设置 Marker
透明?
I mean if i click marker OnMarkerClickListener
is called, so the OnMapClickListener
did not. Even if i set mMap.setOnMarkerClickListener(null);
marker object still masks all click events for underlying map and objects.
How can i set Marker
transparent for all user interractions?
从 3.1.59 版本的库开始,这确实是标记的限制".
This is indeed a "limitation" of markers as of 3.1.59 version of the library.
如果您确实需要它们作为标记,请在 gmaps-api-issues 用于 MarkerOptions.clickable
和 Marker.setClickable
.
If you really need them to be markers, please post a feature request on gmaps-api-issues for MarkerOptions.clickable
and Marker.setClickable
.
如果可以,请考虑使用其他视觉对象,例如GroundOverlay
.唯一的问题是它们与地图不同,与标记不同.最接近的是 Circle
,半径为零,笔画宽度为 20-50 dp,但这只是一个单色点.
If you can, consider using other visual objects, e.g. GroundOverlay
. The only problem is they all scale with map, unlike markers. The closest would be Circle
with zero radius and 20-50 dp stroke width, but that's only a single color dot.