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

utc_offset is deprecated as of November 2019 and will beturned off in November 2020. Use utc_offset_minutes instead.

Open albay13 opened this issue 5 years ago • 13 comments

How can i set the return fields as google maps api documentation said. https://developers.google.com/maps/documentation/javascript/place_field_js_migration

albay13 avatar Nov 26 '19 03:11 albay13

Facing same issue any update on this? It was worknig before suddenly started to showing that error console error => https://i.imgur.com/QSVVEUe.png

utc_offset is deprecated as of November 2019 and will beturned off in November 2020. Use utc_offset_minutes instead. js:70:128 [Vue warn]: Error in v-on handler: "TypeError: e is undefined"

found in

---> <GmapAutocomplete> at node_modules/vue2-google-maps/dist/components/autocomplete.vue <GoogleMap> at src/components/GoogleMap.vue

TypeError: "e is undefined"

webblufter avatar Dec 05 '19 09:12 webblufter

Any updates?

albay13 avatar Dec 23 '19 02:12 albay13

Since, these both utc_offset and opening_hours.open_now are going to be deprecated by the end of 2020, could we expect an update?

k-sai-kiranmayee avatar Dec 30 '19 06:12 k-sai-kiranmayee

I am having the same problem, is there any effective solution? Tks !

manhtlu avatar Feb 04 '20 08:02 manhtlu

Please fix this!

Gyurmatag avatar Feb 13 '20 17:02 Gyurmatag

Based on this stackoverflow answer, calling the Google Maps API without specifying any fields returns all fields (incl utc_offset). PR #688 provides a workaround.

epixian avatar Feb 18 '20 04:02 epixian

i same problem , Please PR and fix thank you so much.

mean-cj avatar Apr 05 '20 08:04 mean-cj

Temporary fix: set the version to 3.38

Vue.use(VueGoogleMaps, { load: { key: 'YOUR_API_KEY', libraries: 'places', v: 3.38 } })

lvl99wzrd avatar Apr 05 '20 12:04 lvl99wzrd

this is because of the method getPlace take all fields when place_changed event fired. Therefore the opening_hours.open_now and utc_offset would be included. You should specify the fields you gonna take, for example autocomplete.setFields(['geometry', 'formatted_address', 'name')

Here is my example code const self = this const inputSearchPlace = document.getElementById('inputSearchPlace') const inputSearchPlaceAutocomplete = new google.maps.places.Autocomplete(inputSearchPlace) inputSearchPlaceAutocomplete.setFields(['geometry', 'formatted_address', 'name']) inputSearchPlaceAutocomplete.addListener('place_changed', function() { self.placeDetail = inputSearchPlaceAutocomplete.getPlace() }

garda-dafi avatar Apr 11 '20 19:04 garda-dafi

Just add 'fields' to the options passed to GmapAutocomplete... I only need the geometry (lat/lng) and don't need the rest of the fields in the response...

<GmapAutocomplete @place_changed="geolocateStart" :options="{fields: ['geometry']}"></GmapAutocomplete

pnijsters avatar Apr 11 '20 23:04 pnijsters

Just as @pnijsters said, using the options attribute did it for me.

Since I needed boh the geometry and the address components, I passe the attribute as :options="{fields: ['geometry', 'address_components']}".

coccoinomane avatar Apr 13 '20 18:04 coccoinomane

It seems that adding this :options="{fields:[]} attribute will help me with this sort of problem. Thank you, everyone.

albay13 avatar Apr 16 '20 09:04 albay13

Hello! Just a doubt though, when I set a location if no options are specified, then these are the values I get in the response, I couldn't find the opening_hours.open_now, am I missing anything? Kindly suggest if any... image

k-sai-kiranmayee avatar May 01 '20 06:05 k-sai-kiranmayee