How do I customize the behavior of basic Google Map location markers?

I work with the Google Maps API, and although 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 (figure below).

Is there a way to remove this behavior or implement my own (so that they are more compatible with the behavior of markers added by my application) by clicking on these locations?

For example, it would be nice to be able to add my own marker when clicking on these markers. Sort of:

defaultMarker.addListener("click", function () {
    myMarker = new google.maps.Marker({ ... });
});

Except ... I don't know a way to capture these markers by default.

Sorry if this was earlier, or if I just missed something basic, but I could not find the documentation for these “default markers” due to the lack of better terminology.

Default Tokens for Google Maps and InfoWindow

+4
source share
2 answers

In the current version 3.24 of the Maps JavaScript API, there is a clickableIcons property in the Map Settings object:

https://developers.google.com/maps/documentation/javascript/reference#MapOptions

You can use this property to disable interactive icons on maps by setting the clickableIcons property to false. There is also a setClickableIcons () method.

Have a look at this example: http://jsbin.com/liyamecoqa/edit?html,output

+5

3.26 .

"click" Map. POI, IconMouseEvent. MouseEvent , placeId.

click , placeId. , Id . stop() , . API- Places, , , , .

, , :

http://jsbin.com/parapex/10/edit?html,output

ClickEventHandler .

+5

All Articles