(document.getElementById(map_container_div),myOptions); if(!getMap(map_container_div)){ VAR MAPINFO </跨度> = { 映射键: ’‘, 地图:’’, 地理编码器:新的google.maps.Geocoder …() }; mapInfo.map = map; mapInfo.geocoder = new google.maps.Geocoder(); mapInfo.mapKey = map_container_div; mapHash.push( MAPINFO </跨度> ); }}
function placeMarker(myAddress …
我自己解决了这个问题,并且因为没有想到这个而踢我自己。 :)
只需添加 mapHash[mapIndex].map.setZoom(12);
mapHash[mapIndex].map.setZoom(12);
我删除了以下2个代码:
bound.extend(results[0].geometry.location); mapHash[mapIndex].map.fitBounds(bound);
由于javascript错误,您的对话框未关闭。 出了点问题 infowindow.open(mapHash[mapIndex],marker); 在你的点击监听器里面。它正在显示窗口,让你认为错误发生在之后,但我很确定它在调用本身。当我调试你没有犯明显的错误,但我仍然认为那行代码是罪魁祸首。
infowindow.open(mapHash[mapIndex],marker);