Google Maps Javascript - unable to load -
i beginner javascript , trying load simple google map in browser (firefox). however, map not load.
below html:
<!doctype html> <html> <head> <title>can guess country?</title> <meta charset="utf-8"> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key={my_api_key}&sensor=true"></script> <script src="mapgame.js"></script> </head> <body> <div id="map"> </div> </body> </html>
below linked mapgame.js:
var map; function initialize() { var mapoptions = { zoom: 8, center: new google.maps.latlng(-34.397, 150.644), maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid('map'), mapoptions); } google.maps.event.adddomlistener(window, 'load', initialize);
any appreciated!
probably has height of div#map
, map there don't see it.
<head> <style> #map { height:500px; } </style> </head>
Comments
Post a Comment