Questions tagged [google-maps-autocomplete]

Autocomplete is a feature of the Places library in the Google Maps JavaScript API. You can use autocomplete to give your applications the type-ahead-search behavior of the Google Maps search field. When a user starts typing an address, autocomplete will fill in the rest.

docs

https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete

demo

https://google-developers.appspot.com/maps/documentation/javascript/examples/full/places-autocomplete

screenshot

enter image description here

47 questions
9
votes
3 answers

Change value of Google Maps Autocomplete field

How do I change the value of a Google Maps autocomplete field after the value has been changed? My ultimate desire is to just show the address in this field, and the city, state, etc in separate fields. As seen by http://jsbin.com/wiye/2/ (script…
4
votes
2 answers

Google Maps autocomplete always select first item

I'm using Google Maps Places V3 autocomplete. I would like to have a functionality where if a user starts typing into the searchfield, the first item from the autocomplete drop down is automatically selected. Similar to the search function in…
3
votes
2 answers

Google Maps Autocomplete doesn't include postcodes in address search

For my current project, I have an address lookup for the user to enter an address. In its default state, its results are too ambiguous, and the lookup returns all locations even if it isn't actually an address (eg some of the locations in the list…
3
votes
2 answers

google maps places autocomplete addEventListener doesn't work

I have been trying to add google maps places auto complete in ionic 2 project to update the user location.However, the addEventListener doesn't seems to work and there is no console errors could anyone tell me where I am going wrong? …
akila arasan
  • 737
  • 3
  • 11
  • 26
2
votes
1 answer

How to get a Google Place using a placeId on Flutter?

I'm trying to find a function that would allow me to get a Google Place only using a placeId (and the apiKey of course). I found the function GeoDataClient.getPlaceById(placeId) but unfortunately this doesn't seem to be available on Flutter. I am…
countpablo
  • 501
  • 1
  • 5
  • 15
2
votes
1 answer

Google Maps Autocomplete API X Geocoder

I'm trying to use Google Maps Autocomplete API but there is some discrepancies between it and Geocoder API, for example: On the autocomplete API, I'm trying to search the address "Rua Tiradentes, 1020, Ibirubá", when I select on the list, the…
1
vote
0 answers

How to fire a click/change event for a custom address with google place autocomplete address in angular 13

I am using google place autocomplete and it's working fine. But I need to add some custom addresses from DB. I did it by custom HTML by catching google place autocomplete CSS class name like (.pac-container). @ViewChild('addressSearch')…
Md.Rohol Amin
  • 41
  • 1
  • 4
1
vote
0 answers

Unsure where to place the Google Maps Autocomplete country restriction

I'm working on the following code and I'm completely baffled as to where to place the Google Maps Autocomplete country restriction. function addMarker(map, features){ var infowindow = new google.maps.InfoWindow(); for (var i = 0,…
1
vote
0 answers

Place.formatted_address in google maps api is undefined

I'm trying to get the value of place.formatted_address, but I don't understand why it's undefined everytime I try to console log the value. I'm using this project for the autocomplete function in google maps const google = window.google; …
DIMSUM LEI
  • 11
  • 2
1
vote
1 answer

Fix the TS2345: Argument of type 'HTMLElement' is not assignable to parameter of type 'HTMLInputElement'

I'm trying to setup Google Maps Places Autocomplete in an new Ionic app. here is the problem. On the first search, I got this error in the console: TypeError: Cannot read property 'place_id' of undefined and this error in the terminal: TS2345:…
Lucien Dubois
  • 1,590
  • 5
  • 28
  • 53
1
vote
0 answers

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined in Angular and google maps autocomplete

I am getting this error when i implement Google autocomplete ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined TypeError: Cannot read property 'nativeElement' of undefined My component is similar to…
1
vote
1 answer

Google Places Autocomplete not returning results for some types

I am using google places autocomplete to suggest schools for my users. The autocomplete is simply not working when I specify the type as school, or point_of_interest as another example. When I specify the type as establishment or geocode the…
1
vote
2 answers

How can I prioritize country in Google map autocomplete?

I would like my autocomplete to show a specified country first, than the other countries. Right now I have this: const autocompleteService = new window.google.maps.places.AutocompleteService() const location = window.google.maps.LatLng(48.856614,…
cappie013
  • 2,354
  • 1
  • 22
  • 30
1
vote
1 answer

How to change route inside the function "autocomplete.addListener()" ? AngularJs Google Maps API

I want On selecting one suggestion the route to be changed to '/blood_test' but its not happening, only getting the console.log properly but on putting the $location.path('/blood_test'); outside the function the route is changing …
1
vote
1 answer

How to add google api script while rendering the component?

I am trying to add the google api script programmatically when it is required. However, I get an error that google is not defined. I can see that the script is added in before the end of the body tag. Earlier I had the script loaded in the…
1
2 3 4