I have a map using Vue2Leaflet, which I try to get the coordinates of the map every time the dragend event fires (when the map location is changed)
<template>
<div id="map" ref="map" style="height: 100vh">
<client-only>
<l-map @dragend="getCoords" :zoom=4 :center="[coords.lat, coords.lon]" :options="{zoomControl: false}">
<l-tile-layer :url="themes.default"></l-tile-layer>
</client-only>
</div>
I tried to access the object this.$refs.map
but it doesn't show the coordinates, how can I get them?
you could use the event
update:center
Example: