I have a Google map that will not appear. The problem seems the same in FF and Chrome, but even more “bad” in IE (always the latest version).
In FF and Chrome, I had a problem with the position: relative;css element style . As soon as I switch (with dev tools) position: absolute(or: fixed);everything is displayed in FF. In Chrome, only the top 30% (top) is displayed on the map.
In IE, the map does not even load.
Here is the script material from <head>. Content is for testing purposes only and does not mean anything. Note. I use this only to download maps. It will be replaced later.
<script type="text/javascript" src="http://maps.google.com/maps/api/js?
file=api&
v=2&
key=<?php echo self::GOOGLE_API_KEY; ?>&
sensor=false">
</script>
<script type="text/javascript">
function initialize()
{
var startpos = new google.maps.LatLng( 50.978056,11.029167 );
var ops = {
zoom: 6
,center: startpos
,mapTypeId:
google.maps.MapTypeId.ROADMAP
,tileSize: new google.maps.Size( 256, 256 )
}
var map = new google.maps.Map( document.getElementById("map_canvas"), ops );
var pos1 = new google.maps.LatLng( 50.7510776,12.4820724 );
var contentString1 = '<div align="left" dir="ltr" class="infowin"><h3>test</h3>testen</div>';
var infowindow1 = new google.maps.InfoWindow( {
content: contentString1
,maxWidth: 5
} );
var marker1 = new google.maps.Marker( {
position: pos1
,map: map
,title: 'test'
} );
google.maps.event.addListener(
marker1
,'click'
,function() {
infowindow1.open( map, marker1 );
}
);
}
</script>
This is the whole mark for the page.
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%;"></div>
</body>
I spent a lot of time on Google without finding anything. Any ideas? Thank!