Gogle Maps API, Map not showing |
Gogle Maps API, Map not showing |
Graniteman1 |
Sep 20 2021, 12:14 PM
Post
#1
|
Group: Members Posts: 1 Joined: 20-September 21 Member No.: 28,102 |
Hi friends,
I cant find any reason to why the map shouldnt show and I have tried all solutions to similiar issues i could find online. I am quite new to coding so I figured i would check with a more experienced crowd. So basically nothing shows up in my browser when i run it. The API is fresh and has been changed twice with same result. I tried adding a "width" element to the style, nothing changed. Here is a discussion of the same issues I tried everything there to no avail. Thanks to anyone taking a look. CODE <!DOCTYPE html> <html> <head> <meta name="viewport" content ="initial scale =1.0, user scalable =no" /> <style type="text/css"> html { height: 100% } body { height: 100%;margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBnKZLeLQvXat0WSFLFwTLbXDKpY0H_BuA"> </script> <script type="text/javascript"> function initialize() { var myoptions = { center: new google.maps.LatLng(56.102156616656956, 12.869099262357109), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } </script> </head> <body onload=initialize ()"> <div id="map_canvas" style ="width:100%; height:100%"></div> </body> </html> |
Lo-Fi Version | Time is now: 25th April 2024 - 07:13 AM |