I have a map that is being created and it seems as part of it is being cut off or off center. I've tried adding google.maps.event.triggerr(map, 'resize') and it is still cutting off. Any ideas?
<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>

Make sure the div displaying your map has a size before you trigger the resize event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With