偵測 Google Map 的 InfoWindow 訊息框是否被開啟 (v3)
因為 Google Map 的 InfoWindow 是被新增出來的物件,所以我們可以透過修改 prototype 的方式,替 InfoWindow 增加新的 method。
google.maps.InfoWindow.prototype.isOpen = function(){
var map = this.getMap();
return (map !== null && typeof map !== "undefined");
}
var popup = new google.maps.InfoWindow();
popup.isOpen(); // will return ture or false.