view plaincopy to clipboardprint var infoWindows = []; view plaincopy to clipboardprint //add infowindow to array infoWindows.push(infowindow); 再加這個就可以了。 view plaincopy to clipboardprint function closeAllInfoWindows() { for (var i=0;i<infoWindows.length;i++) { infoWindows[i].close(); } } 出處: Close all info windows google maps API V3?