Created
April 3, 2014 10:16
-
-
Save thiphariel/9951998 to your computer and use it in GitHub Desktop.
Remove infowindow on Google Maps POI's markers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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