vue-google-autocomplete icon indicating copy to clipboard operation
vue-google-autocomplete copied to clipboard

utc_offset and others Deprecating November 2020

Open nickpoulos opened this issue 5 years ago • 9 comments

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 avatar Dec 17 '19 01:12 nickpoulos

@nickpoulos I am also getting same errors in console. Screenshot 2020-01-22 at 2 43 02 PM

fahad-larasoft avatar Jan 22 '20 09:01 fahad-larasoft

@nickpoulos I got the same errors in console. We really need a fixe for this.

ga-devfront avatar Mar 12 '20 14:03 ga-devfront

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 :)

HugoHeneault avatar Apr 16 '20 09:04 HugoHeneault

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.

eugenefvdm avatar Jun 29 '20 17:06 eugenefvdm

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
};

goldfinch avatar Oct 08 '20 17:10 goldfinch

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

ZaidAbo avatar May 26 '21 12:05 ZaidAbo

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?

rolfo85 avatar Dec 30 '21 03:12 rolfo85

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?

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.

ZaidAbo avatar Dec 30 '21 12:12 ZaidAbo

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?

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.

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']"

rolfo85 avatar Dec 30 '21 14:12 rolfo85