Hi I'm creating the marker like
Marker thisUserMarker = map.addMarker(new MarkerOptions()
.position(new LatLng(CURRENT_LAT, CURRENT_LNG))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_marker_current_location)));
after this i want to make the marker as unclickable, according to the CURRENT_LAT and CURRENT_LNG. Is it possible to do that
I used this workaround, return true when you click on a marker
getMap().setOnMarkerClickListener(new OnMarkerClickListener() {
public boolean onMarkerClick(Marker marker) {
return true;
}
});
Other posibility could be implement implements OnMarkerClickListener and in your onMarkerClick() compare it with the marker that you don't want to be clickable and do nothing.
@Override
public boolean onMarkerClick(final Marker marker) {
if (marker.equals(myMarker))
{
//Do nothing
}
}
You can also check this question : google-maps-api-v2-how-to-make-markers-clickable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With