2
var markers = {};
var openedInfoWindow = null;
function addDoctorLocation(options)
{
var gm = Ext.getCmp('mygooglemap');
var mpoint = new google.maps.LatLng(options.lat,options.lng);
var marker = gm.addMarker(mpoint,options.marker,false,false, options.listeners);
markers[options.MainID] = marker;
infowindow = new google.maps.InfoWindow({
content: "Hello from this marker"
});
google.maps.event.addListener(marker, 'click', function() {
if (openedInfoWindow != null) openedInfoWindow.close(); // <-- changed this
infowindow.open(map, marker);
// added next 4 lines
openedInfoWindow = infowindow;
google.maps.event.addListener(infowindow, 'closeclick', function() {
openedInfoWindow = null;
});
});
}
當點擊infowindow關閉按鈕時,什麼也沒有發生。
當點擊標記將收到此錯誤,但信息窗口上gmappanel無法用googlemap關閉infowindow
TypeError: b.O is not a function
[Break On This Error]
(82 out of range 43)
您是否有鏈接到展現問題的地圖(或jsfiddle)? – geocodezip 2013-03-06 04:56:54
@geocodezip no ..我沒有 – 2013-03-06 09:37:31