Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable onMarkerClickListener completely in Maps API v2

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.

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.

like image 455
Flyview Avatar asked Mar 14 '13 05:03

Flyview


1 Answers

Just override the onclick event:

map.setOnMarkerClickListener(new OnMarkerClickListener() {
    public boolean onMarkerClick(Marker arg0) {
        return true;
    }
});
like image 97
Victor Pinto Avatar answered Oct 11 '22 01:10

Victor Pinto