xkjyeah / vue-google-maps

Google maps component for vue with 2-way data binding
https://xkjyeah.github.io/vue-google-maps/
1.88k stars 474 forks source link

How to move camera to position #752

Open delphiy opened 3 years ago

delphiy commented 3 years ago

How to move camera to position ?

recsamrc commented 3 years ago

For me, I added a ref to the CMap Component then the code to change position would look like this

let position = {
    lat: latitudeValue,
    lng: longitudeValue
};
this.$ref.mapRef.$mapPromise.then(map => map.panTo(position));

it tells the map to move to that position