i'm program a small javascript application for our local firefighter home. The application is a little like powerpoint etc. but in html. In this application i would show a google maps map with a route that shows the way from the firefighter home to the fire. I use jquery for requesting the data from the http server.
My Problem is that i have inserted the code for the google maps api and the browser shows me the maps object with the google logo and so on. But there is no map, there is only a gray background. With the mouse it seems that i can zoom in/out, scroll etc in the map (if i interact, in firebug comes datatransfers to the google api), but the map wasn't there.
My personal maps api key is inserted and if i delete it the plugin shows a failure. So i think that can't be the problem.
is there a problem with jquery and the maps api? Anyone else around having this problem?
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="./css/standard.css">
<script src="./js/libs/jquery-1.9.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?key=api_key&sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(50.98188, 6.78655),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
window.console.log("Position center: "+map.getCenter()+"\nZoom: "+map.getZoom());
map.setZoom(12);
map.setCenter(new google.maps.LatLng(0, 0));
window.console.log("Position center: "+map.getCenter()+"\nZoom: "+map.getZoom());
}
</script>
</head>
<body>
<div id="site_content">
<div id="head_left" class="background_box">
</div>
<div id="head_center" class="background_box">
<div class="heading"></div>
</div>
<div id="head_right" class="background_box">
<h1 class="date_data"></h1>
<h1 class="time_data"></h1>
</div>
<div class="spacing_data"></div>
<div id="data_box" class="background_box">
<div id="map_canvas" style="width: 100%;height: 100%"></div>
</div>
<div class="spacing_data"></div>
<div id="footer_left" class="background_box">
</div>
<div id="footer_center" class="background_box">
<div class="footer"></div>
</div>
<div id="footer_right" class="background_box">
</div>
</div>
<script>
jQuery.getScript("./js/initialisation.js",function(){initialisation();});
initialize();
</script>
</body>
there is no content because this is all loaded at runtime from the server over jquery and then inserted into dom.