Google Maps allows Points of Interests such as Restaurants and stuff to appear clickable and displays their infowindows when clicked which is not what I want. I need only the infowindows attached to my polygons to be clickable and pop open infowindows. I noticed that a way of fixing this would be changing the style of the google maps:
[
{
featureType: "poi.business",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
]
Ok I made a function that can remove most of the features:
/**
* Remove all other unnecessary infowindows by rendering Points of Interest invisible
* Takes the map, applicable for Google Maps API
**/
function suppressUnnecessayInfoWindows(mapUsed) {
// removes POIs and Transit features off the map
var noFeatures = [
{
featureType: "poi",
stylers: [
{ visibility: "off" }
]
},
{
featureType: "transit",
stylers: [
{ visibility: "off" }
]
}
];
// changes the style of the map so that the above is no longer visible
mapUsed.setOptions({styles: noFeatures});
}