Reputation: 137
Can I to use Google maps geocode API without map? I have a textbox with autocomplete Google Maps API Place and I want after the user has typed the street number, I get the zip code. Regards
Upvotes: 2
Views: 6400
Reputation: 386
Autocomplete is one of a small number of cases where it is permitted to use a Google Maps API service without a map, although if you do use it in conjunction with a map that map must be a Google Map:
https://developers.google.com/maps/documentation/javascript/places#places_autocomplete
You don't need to use the Geocoder to extract the zipcode. It is provided in the PlaceResult object returned by a getPlaces() call on the Autocomplete object after place_changed event has occurred (ie. once a user has selected a completion):
https://developers.google.com/maps/documentation/javascript/places#getting_place_information
Upvotes: 2
Reputation: 6362
I'm sure that you can. Check out the Geocoding API. It's simply a set of web services you can call to get a geocoding result that contains the postal code, among other things.
Upvotes: 1