현재 Google지도의 아이콘을 만들려면이 작업을 수행하십시오. 루프, 마커를 닫기 위해, 내가이 비슷한을 알고에다른 정보 창이 멋지게 닫습니다.
function createMarker(posn, title, html) {
var marker = new google.maps.Marker({ position: posn, title: title, draggable: false });
marker['infowindow'] = new google.maps.InfoWindow({ content: html });
infoWindows.push(marker['infowindow']);
google.maps.event.addListener(marker, "click", function() {
for (i = 0; i < infoWindows.length; i++) {
infoWindows[i].close();
}
this['infowindow'].open(map, this);
});
return marker;
}
메신저 행복하지가 하나 refernce를 사용하여 수행 할 수 있습니다 :
경우 (정보창) infowindow.close()를; 내가 다른
markers[myPoint]['infowindow'].open(map, markers[myPoint]);
곳과 같은 일을하고 있기 때문에
내가 좋아하는 위의 코드를 사용하고있는 이유는 (myPoint는 숫자)입니다.
어떻게하면 오픈 infowindows를 닫고 좋은 방법으로 루프를 피할 수 있습니까?
http://code.google.com/apis/maps/documentation/javascript/reference.html#InfoWindow 버그 되세요. 그것은 정보창을 다시 표시하지 않습니다. 수정하려면 을 제거하십시오. (activeInfoWindow == this [ 'infowindow'] { return;} – nguyencse