javascript - Modify Google autocomplete predictions with my predictions -


i working on gmaps project , using gmaps javascript apiv3. have included gmaps search box gives predictions calling autocomplete service. predictions fetches service ok, in addition want show prediction database well.

i have created:

    var input = document.getelementbyid('pac-input');     var searchbox = new google.maps.places.searchbox(input);     map.controls[google.maps.controlposition.top_left].push(input); 

searchbox gives predictions expected. instead of default predictions given autocompleteservice, want add predictions well.

i cannot find tutorials/guides in internet , other questions question, maybe not possible because prediction on autocomplete based on places library.

you can check in introduction part of autocomplete.

autocomplete feature of places library in google maps javascript api. can use autocomplete give applications type-ahead-search behavior of google maps search field. when user starts typing address, autocomplete fill in rest.

in order use autocomplete, need load google places library using libraries parameter in bootstrap url google maps javascript api.

the idea document may give how retrieve predictions autocomplete service.

you can use getplacepredictions() returns place predictions. note: 'place' can establishment, geographic location, or prominent point of interest, defined places api. , getquerypredictions() returns extended list of predictions, can include places (as defined places api) plus suggested search terms. example, if user enters 'pizza in new', pick list may include phrase 'pizza in new york, ny' names of various pizza outlets.

for more information read documentation autocomplete , check sample code.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -