All Projects → lewagon → google-place-autocomplete

lewagon / google-place-autocomplete

Licence: other
Exemple of Google Place Autocomplete Javascript API

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Google Place Autocomplete

This sample code show you how to quickly use the Places Autocomplete javascript API from Google.

See demo right now

Code

Look at the index.html file, you'll see a very standard form. The input with id user_input_autocomplete_address is very important as it is bound to an autocomplete object in the autocomplete.js code.

The code you see is not dependent on jQuery, also the initializeAutocomplete method has to be called when google is ready, not just when the DOM is ready.

API Key

In order to get a lot of requests for free to the API, you need to create a new project under the Google API Console. For this project, enable the Google Maps Javascript API v3:

Then, for this project, create a new "Browser Key", the one you'll put in the index.html file when calling the https://maps.googleapis.com/maps/api/js script.

Make sure to specify referers so that only you can use this key! Remember, you API calls are limited per day.

Documentation

Full Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].