【发布时间】:2014-02-02 18:21:00
【问题描述】:
是否可以默认打开所有信息窗口。我尝试了以下方法,但它不起作用:
var infowindow = new google.maps.InfoWindow({
maxWidth: 160
});
// Add the markers and infowindows to the map
for (var i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map,
icon: icons[iconCounter]
});
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
【问题讨论】:
-
为什么这个标签是google-maps-api-2 (the deprecated and turned off version of the api?为该版本的 API 开发新代码并不是一个好主意。另请注意,Google Maps Javascript API v3 支持多个 InfoWindows,v2 不支持。
标签: javascript google-maps google-maps-api-2