我正试图管理<条码>InfoWindow条码>的透镜。 页: 1 我阵列的定义是全球性的,因此我可以管理所有<条码>Infowindow物体,如:
I edited the code to add some details as Sean told:
google.maps.event.addListener(markers[id], click , function() {
for ( var i = 0; i < infowindows.length; i++ ) {
var infoWin = infowindows[i];
if ( infoWin === undefined || infoWin === null ) {
continue;
}
infoWin.close();
}
map.panTo(markers[id].getPosition());
infowindows[id].open(map,markers[id]);
});
The .close()
function is not doing anything. I know that I am accessing the objects in a proper way because I can call .open()
and it works. Anyone have an idea about this issue?
Thanks!
EDIT (14 / 8 /2012): 这似乎与安保部存在问题,因此,当我用一些JQuery显示地图时,我设法通过强迫展示方式加以固定:
$( #google-map ).css("display", "block !important");
感谢你们的友好回答!