我有几个InfoBox如下:
var labels = [
new InfoBox({
content: "Old Town (Stare Mesto)",
position: new google.maps.LatLng(50.088979, 14.414921),
boxStyle: {
border: "2px solid white",
textAlign: "center",
color: "white",
fontSize: "8pt",
fontWeight: "bold",
width: "200px",
height: "17px",
background: "black",
opacity: 0.5,
filter: "alpha(opacity=50)"
}
}),
new InfoBox({
content: "New Town (Nove mesto)",
position: new google.maps.LatLng(50.084243, 14.424405),
boxStyle: {
border: "2px solid white",
textAlign: "center",
color: "white",
fontSize: "8pt",
fontWeight: "bold",
width: "200px",
height: "17px",
background: "black",
opacity: 0.5,
filter: "alpha(opacity=50)"
}
})
];
如果我在地图上添加它们
for (var i in labels) {
labels[i].open(map);
}
然后将地图视口移动到这些标签。即使我调用map.setCenter(someLatLngObject)中心也被卡在那些InfoBox上。
预期会出现这种情况吗?
答案 0 :(得分:2)
您是否尝试过disableAutoPan选项?
new InfoBox({
disableAutoPan: true,
content: "New Town (Nove mesto)",
position: new google.maps.LatLng(50.084243, 14.424405),