如何在我的地圖上顯示兩個Infowindow。InfoWindow與Google地圖apı
在我的代碼中我只能打開一個InfoWindow,但是我會同時在我的地圖上顯示兩個InfoWindow,我該怎麼辦。我的代碼是:
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(38.736946, 35.310059), 6);
map.openInfoWindow(new GLatLng(38.582526, 42.846680),
document.createTextNode("Van Gölü"));
}
}
您使用谷歌地圖API V2(儘管標記你的問題的API v3的 - 我會正確地重新打吧)。 v2 API已棄用,並將於[2013年5月]停止工作(https://developers.google.com/maps/documentation/javascript/v2/)。您應該將其重寫爲API v3 – duncan 2013-02-12 13:44:32
如何使用apı版本3 – 2013-02-12 14:17:19
[google mapsapı處理html和javascript]的可能重複(http://stackoverflow.com/questions/14829843/google-maps-api-processing-與-html和JavaScript) – geocodezip 2013-02-12 14:35:11