I am developing an simple app, where I already displayed marker title with mrkr.showInfoWindow()
but I don't want user to tap again that marker. How to disable clicking event of particular marker ?
This is how I tried.
Marker marker = gMap.addMarker(new MarkerOptions().position(new LatLng(location
.getLatitude(), location.getLongitude())).title("I am here").icon(BitmapDescriptorFactory.fromResource(R.drawable.mrk1)));
marker.showInfoWindow();
//how to use marker.setClickable here or somthing here.?
How to display that infowindow()/title of my marker throughout my application ?
To remove a marker from the map, call the setMap() method passing null as the argument. marker. setMap(null);
Map(document. getElementById("map"), mapOptions); // To add the marker to the map, use the 'map' property var marker = new google. maps. Marker({ position: new google.
You can set onMarkerClickListener in GoogleMap object
Java:
map.setOnMarkerClickListener(new OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
return true;
}
});
In Kotlin, you can simply do:
map.setOnMarkerClickListener { true }
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