Closed lightman0215 closed 2 years ago
Hi @lightman0215
I think you'll first need to instantiate PlacesService
:
https://developers.google.com/maps/documentation/javascript/reference/places-service#PlacesService.constructor
Something like this:
const service = new this.$refs.dianzhuangMap.api.places.PlacesService(this.$refs.dianzhuangMap.map)
HTML Code `<GoogleMap ref="dianzhuangMap" id="Mapdian" @click="getStations" :language="$i18n.locale" :key="dataForm.name" api-key="AIzaSyAU9sDf9Nc1IJjCKqEfcAM-obouMK_eodY" style="width: 100%; height: 700px" :center="center" :zoom="10">
Vue:
const service = this.$refs.dianzhuangMap.api.places.PlacesService; service.findPlaceFromQuery(request, (results: any, status: any) => { console.log(results); });
how can i fix it?