禁用onMarkerClickListener完全地图API第2版 [英] Disable onMarkerClickListener completely in Maps API v2
问题描述
我想禁用单击/轻敲地图标记
。我知道你能禁用默认行为
通过建立一个空的 map.setOnMarkerClickListener
键,返回true;然而,这仍需要龙头的点击标记。我想通过水龙头到 onMapClickListener
。
I want to disable clicking/tapping on map markers
. I know you can disable default behavior
by setting up an empty map.setOnMarkerClickListener
and return true; However, this still takes the tap as clicking on the marker. I want to pass the tap on to the onMapClickListener
.
在我的应用程序,点击地图上移动的标记左右,而如果你攻接近的地方标记为已,只是觉得你敲击的标志!你可能会认为这是一个 Marker.setClickable
方法,但没有。
In my app, tapping the map moves a marker around, and if you're tapping close to where the marker is already, it just thinks you're tapping the marker! You would think there is a Marker.setClickable
method but there isn't.
推荐答案
只是覆盖onclick事件:
Just override the onclick event:
map.setOnMarkerClickListener(new OnMarkerClickListener() {
public boolean onMarkerClick(Marker arg0) {
return true;
}
});
这篇关于禁用onMarkerClickListener完全地图API第2版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!