Reputation: 95
I would like to simply recreate the map interface of this page of the Google Maps API tutorial: https://developers.google.com/maps/documentation/javascript/examples/places-searchbox . So, I want to have a map on my webpage that enables search by location with autocomplete using the Google Places and Maps API. At the link above, they post the HTML code used to create the map interface; however, when I copy the code into notepad++ and create an .html file from it, the map does not appear. Is there a bug in the code in the tutorial (click on the "Java + HTML" code to see it)?
Upvotes: 0
Views: 784
Reputation: 2738
Using the chrome debugger, the thing that is missing is the css file that is being requested
failed to load resource: file://localhost/maps/documentation/javascript/examples/default.css
you need to change the url of the css stylesheet inside the html from :
<link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet">
to :
<link href="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
and it will work
Upvotes: 2