I've been working with the Google Maps API, and while I can add and customize my own markers and info windows, the base map has these default markers that display these info windows when clicked (picture below).
Is there any way to remove this behavior or implement my own (to make them more consistent with the behavior of markers my application adds) when clicking on these locations?
For example, it'd be nice to do be able to add my own marker upon clicking these markers. Something like:
defaultMarker.addListener("click", function () {
myMarker = new google.maps.Marker({ ... });
});
Except... I don't know of a way to grab these default markers.
Apologies if this has been answered before, or if I've just missed something basic entirely, but I couldn't find any documentation about these "default markers", for lack of better terminology.
The current release version 3.24 of Maps JavaScript API has a property clickableIcons in the Map Options object:
https://developers.google.com/maps/documentation/javascript/reference#MapOptions
You can use this property to turn off clickable icons on maps by setting the clickableIcons property to false. Also exists a setClickableIcons() method.
Please look at this example: http://jsbin.com/liyamecoqa/edit?html,output
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