Reputation: 54949
I am trying to use autocomplete in Google Maps. I am getting the results. but i want to college the results and feed it to my themes Autocomplete Plugin to make it look better. I am not able to get the list of the places as a modifiable variable array.
var zoomLevel = 13;
var lat = 13.00487;
var lng = 77.576729;
var mapOptions = {
center: new google.maps.LatLng(lat, lng),
zoom: zoomLevel,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
var input = document.getElementById('search-google-places');
var options = {
types: ['geocode']
};
var autocomplete = new google.maps.places.Autocomplete(input, options);
var place = autocomplete.getPlace();
console.log(place);
Upvotes: 0
Views: 2642
Reputation: 117314
Request the autocompleteService directly instead of using a places.Autocomplete, the response will give you the predictions.
Upvotes: 1