vue-google-autocomplete
vue-google-autocomplete copied to clipboard
utc_offset and others Deprecating November 2020
As of the last few weeks I have been getting errors in my console about fields being deprecated in November 2020. The two fields in question are utc_offset and open_now.
utc_offset is deprecated as of November 2019 and will beturned off in November 2020. Use utc_offset_minutes instead.
https://developers.google.com/maps/documentation/javascript/place_field_js_migration
@nickpoulos I am also getting same errors in console.

@nickpoulos I got the same errors in console. We really need a fixe for this.
So based on https://github.com/olefirenko/vue-google-autocomplete/pull/103, I removed the utc_offset field. You can find it on https://github.com/Ipocamp/vue-google-autocomplete
I didn't manage to get it working with the new utc_offset_minutes but if you wanna try do it :)
For those who don't understand why @HugoHeneault 's fork is so important, if you query the entire result set you will be charged more for API calls by Google. A few years ago this wasn't an issue, but it now certainly is.
For those who are still looking for a solution: just specify 'fields' in options
https://github.com/olefirenko/vue-google-autocomplete/blob/master/src/VueGoogleAutocomplete.vue#L123
const options = {
fields: ['geometry', 'address_components', 'place_id'] // or any other fields you need
};
To me i've just added
:fields="['geometry', 'formatted_address', 'name']" to VueGoogleAutocomplete component and it solved my problem .... option param did not work for me
To me i've just added
:fields="['geometry', 'formatted_address', 'name']"to VueGoogleAutocomplete component and it solved my problem .... option param did not work for me
In which way do I retrive the values using that array fields?
Once I add the array to the component, my v-on:placechanged="getAddressData" no longer works?
To me i've just added
:fields="['geometry', 'formatted_address', 'name']"to VueGoogleAutocomplete component and it solved my problem .... option param did not work for meIn which way do I retrive the values using that array
fields?Once I add the array to the component, my
v-on:placechanged="getAddressData"no longer works?
Here is an example of my code :
<VueGoogleAutocomplete :id="id" :classname="classes" country="US" :placeholder="placeholder" :fields="[ 'address_components', 'adr_address', 'alt_id', 'formatted_address', 'geometry' ]" @change="setValues" @placechanged="getAddressData" />
And then in methods:
getAddressData(addressData, place) { console.log(addressData) console.log(place) }
Then this func will logs on placechange And it should be without problem.
To me i've just added
:fields="['geometry', 'formatted_address', 'name']"to VueGoogleAutocomplete component and it solved my problem .... option param did not work for meIn which way do I retrive the values using that array
fields? Once I add the array to the component, myv-on:placechanged="getAddressData"no longer works?Here is an example of my code :
<VueGoogleAutocomplete :id="id" :classname="classes" country="US" :placeholder="placeholder" :fields="[ 'address_components', 'adr_address', 'alt_id', 'formatted_address', 'geometry' ]" @change="setValues" @placechanged="getAddressData" />And then in methods:getAddressData(addressData, place) { console.log(addressData) console.log(place) }Then this func will logs on
placechangeAnd it should be without problem.
Thank you!
In order for getAddressData to be triggered, there must be at least these 4 fields declared :fields="['geometry', 'formatted_address', 'name', 'address_components']"