On my website i have a Google Map but it don´t show the thing i want. When its loaded it shows this. Then i minimize my screen and it shows the map.
This is my code:
<div id="view1">
<?php
$location = get_field('locatie_beschrijving');
if( ! empty($location) ):
?>
<div id="map" style="width: 800px; height:300px "></div>
<script src='http://maps.googleapis.com/maps/api/js?sensor=false' type='text/javascript'></script>
<script type="text/javascript">
//<![CDATA[
function load() {
var lat = <?php echo $location['lat']; ?>;
var lng = <?php echo $location['lng']; ?>;
// coordinates to latLng
var latlng = new google.maps.LatLng(lat, lng);
// map Options
var myOptions = {
zoom: 9,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
//draw a map
var map = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({
position: map.getCenter(),
map: map
});
}
// call the function
load();
//]]>
</script>
</div>
Anyone an idea what's wrong?