iw3schools Posted July 3, 2017 Share Posted July 3, 2017 (edited) Hi over there, I'm trying to add a google map to a really simple .html file (locally stored), just to understand how it works. I've just copied a code snippet found on w3schools, here it is: <!DOCTYPE html> <html> <body> <h1>My First Google Map</h1> <div id="googleMap" style="width:100%;height:400px;"></div> <script> function myMap() { var mapProp= { center:new google.maps.LatLng(51.508742,-0.120850), zoom:5, }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); } </script> <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&callback=myMap"></script> </body> </html> and pasted an API key I've generated and enabled on a google account. I pasted the key over "YOUR_KEY". So basically my file contains exactly the code above, the only difference consist in the API key instead of "YOUR_KEY". Can anyone tell me where I may be wrong? Thank you in advance, really. Edited July 3, 2017 by iw3schools Link to comment Share on other sites More sharing options...
dsonesuk Posted July 3, 2017 Share Posted July 3, 2017 It should work if API key is correct, is there a time period you should wait, before using it? Link to comment Share on other sites More sharing options...
iw3schools Posted July 12, 2017 Author Share Posted July 12, 2017 hi dsonesuk, thank you for your answer. I have waited a long indeed, tried and re-tried, but it doesn't work. Thank you anyway. Link to comment Share on other sites More sharing options...
dsonesuk Posted July 24, 2017 Share Posted July 24, 2017 See http://w3schools.invisionzone.com/index.php?/topic/56747-google-maps-api/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now