1. используйте эту библиотеку https://github.com/xkjyeah/vue-google-maps
npm install vue2- google-maps
или
yarn add vue2- google-maps
// somewhere u initialize main Vue app instance or install vue plugin, maybe in main.js
import Vue from 'vue';
import * as VueGoogleMaps from 'vue2-google-maps';
Vue.use(VueGoogleMaps, {
load: {
key: 'YOUR_API_KEY',
libraries: '', // google map library u want to use
},
installComponents: true
});
import Vue from 'vue';
import {gmapApi} from 'vue2-google-maps';
export default class SomeComponent extends Vue {
computed: {
google: gmapApi,
},
data() {
return {
placeId: '',
geocoder: null
}
}
mounted() {
this.$gmapApiPromiseLazy().then(() => {
if(this.google) {
this.geocoder = new this.google.maps.Geocoder();
}
});
},
methods: {
geocode() {
this.geocoder.geocode({placeId: this.placeId}, (results, status) => {
console.log(results,status);
})
}
}
}
после некоторых исследований документации карты Google, для поиска по placeId вы, скорее всего, будете использовать геокодер
https://developers.google.com/maps/documentation/javascript/reference/geocoder
https://developers.google.com/maps/documentation/javascript/examples/geocoding-place-id
2. rest api https://developers.google.com/maps/documentation/geocoding/intro#place -id
должно быть примерно так:
https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFUEcm_qrcA&key=YOUR_API_KEY