algolia / places
- пятница, 17 июня 2016 г. в 03:12:20
JavaScript
🌐 Turn any into an address autocomplete
Turn any <input> into an address autocomplete
Algolia Places provides a fast, distributed and easy way to use an address search autocomplete JavaScript library on your website.
See the website for more information.
Watch more examples on the website.
To use Algolia Places, all you need is an <input>
and some JavaScript code that will load
and use the places.js library.
<script>
Our JavaScript library is available on the jsDelivr CDN.
<script src="https://cdn.jsdelivr.net/places.js/1/places.min.js"></script>
Here's a small example using it:
<input type="search" id="address-input" placeholder="Where are we going?" />
<script>
var placesAutocomplete = places({
container: document.querySelector('#address-input')
});
</script>
Algolia Places is also available on npm.
Install the module:
npm install places.js --save
Put an <input>
in your html page:
<input type="search" id="address-input" placeholder="Where are we going?" />
Initialize the places.js library:
var places = require('places.js');
var placesAutocomplete = places({
container: document.querySelector('#address-input')
});
Full documentation is available on the Algolia Places website.
Wanna contribute? Awesome, please read the contributing guide.