javascript - Google maps map not loading -
i've read ton of solutions problem, non of them worked me. map not loading
here html
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script> <script> var map; function initialize() { var mapoptions = { zoom: 8, center: new google.maps.latlng(41.7429109,24.391538699999955) }; map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); } google.maps.event.adddomlistener(window, 'load', initialize); </script> </head> <body onload="initialize()"> <div id="map_canvas"></div> </body>
the css think problem somewhere here
body { height:100%; width:100%; margin: 0; padding: 0; line-height: 1.5em; font-family: georgia, "times new roman", times, serif; font-size: 12px; color: #666; background:#302f2f ; } #map_canvas { width:300px; height:300px; }
so please help me
your html element has id 'map_canvas', javascript has 'map-canvas'.
it cannot find element cos you're spelling id wrong! :o)
javascript html google-maps maps
No comments:
Post a Comment