olefirenko / vue-google-autocomplete

A Vue.js autosuggest component for the Google Places API.
https://olefirenko.github.io/vue-google-autocomplete/
MIT License
507 stars 258 forks source link

Possible to get administrative_area_level_2, sublocality, and neighborhood? #108

Open holmesworcester opened 5 years ago

holmesworcester commented 5 years ago

Thanks for your work on this!

Right now I'm having a problem where, for addresses in Brooklyn, NY, nothing is returned for locality. I have no idea why this is. For addresses in smaller U.S. cities, locality is the city.

But I'm wondering if it's possible to get fields like administrative_area_level_2, sublocality or neighborhood so that I have other things to display if locality isn't returned.

The Google Maps API docs seem to say that this is possible for reverse geocoding: https://developers.google.com/maps/documentation/geocoding/intro#reverse-example

samiurz commented 5 years ago

Facing the same issue. Need to save locality. It is showing while typing but not saving in the database.

victormarques-docway commented 5 years ago

Hello everyone, any solution?

lggwettmann commented 4 years ago

Same question here but with postal_code.

shreeraj-bacancy commented 3 years ago

For the locality missing issue, one can directly have the same formatted address as shown in the drop-down list.

:fields="['formatted_address','address_components','geometry']"

Just add these fields and you will have formatted_address key including locality in the place object which is retrieved with v-on:placechanged

This worked for me.