我有一张正在创建的地图,它的一部分似乎被切断或偏离中心。我试过添加google.maps.event.triggerr(map, 'resize')
,它仍然被切断。有任何想法吗?
<script language="JavaScript">
var map;
function initialize() {
var mapOptions = {
zoom: 15,
center: new google.maps.LatLng(<?=$lat?>, <?=$long?>),
mapTypeId: google.maps.MapTypeId.ROADMAP,
};
map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
}
//google.maps.event.trigger(map, 'resize');
google.maps.event.addDomListener(window, 'load', initialize);
</script>