Hi am new to google maps. I have used gmaps jquery plugin for displaying map. In that i have my own markers and polylines for some locations,and displaying the infowindow wh
The easiest and most efficient way to prevent this behavior is to call the stop() method on a click event attached to the Map instance.
map.addListener("click", e => e.stop());
There is a close() function for InfoWindows. Just keep track of the last opened window, and call the close function on it when a new window is created.
This demo(http://www.lootogo.com/googlemapsapi3/markerPlugin.html) has the functionality you're looking for. I found it in the Maps API V3 demo gallery.
I think the only way to prevent those infowindows from opening is to turn off the POIs using styled maps, something like:
[
{
"featureType": "poi",
"stylers": [
{ "visibility": "off" }
]
}
]
var stylesArray = [
{
featureType: '',
elementType: '',
stylers: [
{hue: ''},
{saturation: ''},
{lightness: ''},
// etc...
]
},
{
featureType: '',
// etc...
}
]
you can change its features like hide the feature completely as below
stylers: [
{ visibility: "off" }
]
you can refer link about the poi as below if you are using the version3
https://developers.google.com/maps/documentation/javascript/styling
hope this helps :D