The map zoom doesn't seem to be working correctly #217
-
I would like for the map to set the zoom level to 8 when a marker is clicked and that the zoom level is < 6 To do so I implemented this function const zoom = ref(4);
function clickMarkerEvent(i) {
console.log(zoom.value)
if(zoom.value < 6){
console.log('Zooming')
zoom.value = 8;
} And I call it whenever a marker is clicked <Marker v-for="(address, i) in addresses.data" @click="clickMarkerEvent" :options="{position: address.position, icon: {url: address.icon, scaledSize: { width: 25, height: 25 }}}">
...
</Marker> However, it works as expected the first time I click on a marker but then, eventho I zoom and dezoom, the zoom value seems to be static My conclusions are that the zoom value isn't changed when the map is zoomed or dezoomed but does change the map zoom if changed programmatically |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is intended behavior; a property doesn't automatically behave like a v-model (getter & setter). You have to get the zoom via the |
Beta Was this translation helpful? Give feedback.
This is intended behavior; a property doesn't automatically behave like a v-model (getter & setter).
You have to get the zoom via the
@zoom_changed
event. It doesn't output anything (again, intended behavior), so you have to get the zoom withgetZoom
and likely set the zoom withsetZoom
instead of just changing the property.