禁用自定义标记点击事件

时间:2017-03-14 07:09:20

标签: android google-maps google-maps-api-3 google-maps-markers

我已尝试How to disable marker click event?How do I disable click on a map marker in android?How to disable android map marker click auto center链接,但仍然标记可点击,它会删除显示的信息窗口。请为我提供正确的解决方案。

CODE

Marker marker = mMap.addMarker(options);
        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latlng, 12.0f));
        mMap.setInfoWindowAdapter(new CustomInfoWindow());
        marker.showInfoWindow();/*Show infowindow by default.*/
        mMap.setOnInfoWindowClickListener(null);/*Disable click on info wndow.*/
        mMap.getUiSettings().setScrollGesturesEnabled(false);/*Disable map scrolling.*/
        mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
            @Override
            public boolean onMarkerClick(Marker marker) {
                return true;
            }
        });

0 个答案:

没有答案