Closed Domi-4102 closed 2 years ago
The watcher won't trigger if the value is the same. You'll have to re-center manually I'm afraid.
You can use panTo as mentioned in google API to change the center:https://developers.google.com/maps/documentation/javascript/reference/map#Map.panTo
template :
<GoogleMap
ref="mapRef"
api-key="YOUR_GOOGLE_API_KEY"
style="width: 100%; height: width: 100%"
:center="center"
:zoom="11"
/>
in your script:
if (mapRef.value?.ready) {
mapRef.value.map.panTo({ lat: newLat, lng: newLng });
}
Hi , i tried to edit the property center after initialization but it didn't work
It didn't update if you pass the same value but the view of the map is different.