Skip to content

Instantly share code, notes, and snippets.

@thiphariel
Created April 3, 2014 10:16
Show Gist options
  • Select an option

  • Save thiphariel/9951998 to your computer and use it in GitHub Desktop.

Select an option

Save thiphariel/9951998 to your computer and use it in GitHub Desktop.
Remove infowindow on Google Maps POI's markers
function fixInfoWindow() {
//Here we redefine set() method.
//If it is called for map option, we hide InfoWindow, if "noSupress" option isnt true.
//As Google doesn't know about this option, its InfoWindows will not be opened.
var set = google.maps.InfoWindow.prototype.set;
google.maps.InfoWindow.prototype.set = function (key, val) {
if (key === 'map') {
if (!this.get('noSupress')) {
console.log('This InfoWindow is supressed. To enable it, set "noSupress" option to true');
return;
}
}
set.apply(this, arguments);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment