似乎页面加载上谷歌地图信息框的位置是错误的,或者当您将地图高度设置为低于 400/380 像素时至少是错误的示例 http://jsfiddle.net/TbDzG/18/
var startLocation = new google.maps.LatLng(36.151685,-115.152438);
function initialize() {
var mapOptions = {
center: startLocation,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map-canvas"),
mapOptions);
var marker = new google.maps.Marker({
position: startLocation,
map: map,
draggable:true,
animation: google.maps.Animation.DROP,
title:"Hello World!"
});
var infowindow = new google.maps.InfoWindow();
infowindow.setContent('some content here');
infowindow.open(map, marker);
}
google.maps.event.addDomListener(window, 'load', initialize);
有谁知道如何将其移动到正确的位置并使信息框居中而不是使标记居中的技巧?