Closed MyLittlePolygon closed 8 years ago
How would you ideally want this to work? If a match was found with autocomplete would it just show that one location?
I think it would be a nice enhancement, something more like typeahead.js autosuggestion/autocomplete
If you need google places autocomplete is really really simple to add.
If you're using default input IDs ("#bh-sl-address"), then do like this:
1) when you call Google maps API, simply call the places library https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places®ion=US
2) apply the places lib to the address input:
(function($) { $(document).ready(function() { var autocomplete; var geocoder; var input = document.getElementById('bh-sl-address'); var options = { componentRestrictions: {'country':'us'}, types: ['(cities)'] }; autocomplete = new google.maps.places.Autocomplete(input,options); }); })(jQuery);
3) You're good to go.
I don't think that the author should add this built in due to the simplicity of doing by yourself.
Good luck!
There is now an option in v2.4.2 of the plugin for Google Places autocomplete and an example file included
Hi guys,
Very nice plugin @bjorn2404. and thanks to share w/ us ;) I'm trying to add autocomplete, but I can not make it work. Anyone know how to add autocomplete?
Thanks