Open albay13 opened 4 years ago
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
--->
Any updates?
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?
I am having the same problem, is there any effective solution? Tks !
Please fix this!
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.
i same problem , Please PR and fix thank you so much.
Temporary fix: set the version to 3.38
Vue.use(VueGoogleMaps, { load: { key: 'YOUR_API_KEY', libraries: 'places', v: 3.38 } })
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() }
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
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']}"
.
It seems that adding this :options="{fields:[]}
attribute will help me with this sort of problem. Thank you, everyone.
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...
How can i set the return fields as google maps api documentation said. https://developers.google.com/maps/documentation/javascript/place_field_js_migration