我的地图上有一些标记,每个标记都有infowindow。地图很小,大约260px / 260px,所以infowindow popup太大了。我想将此弹出窗口调整为较小的尺寸,但没有效果。这是我的代码 - 我尝试使用maxWidth - 没有效果,并使用infowindow.resize(50,50) - >错误“infowindow不是函数”:
for (var i = 0; i < arraylng.length-1; i++) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(arraylng[i], arraylat[i])
});
var infowindow = new google.maps.InfoWindow({
content: " ",
maxWidth: 10
});
makeInfoWindowEvent(map, infowindow, marker, i);
markers.push(marker);
}
var currentMarker;
function makeInfoWindowEvent(map, infowindow, marker, i) {
google.maps.event.addListener(marker, 'click', function() {
currentMarker=marker;
Googleapi.GetAddressMarker(arrayidunion[i], setmarker); // webservice
});
}
function setmarker(result)
{
var address1 = result;
infowindow.setContent(address1);
infowindow.open(map, currentMarker);
}
答案 0 :(得分:0)