leaflet-map icon indicating copy to clipboard operation
leaflet-map copied to clipboard

marker draggable=true won't update it's latitude/longitude values after being dragged

Open nylki opened this issue 10 years ago • 0 comments

In the following example I expect the circle to update it's position once the marker is dragged. Even when manually printing out latitude and longitude via on-drag the marker always shows only the initial values I set. Do I miss something or is it a bug?

<leaflet-map fitToMarkers="true">
    <leaflet-marker on-drag="updateCircle" draggable="true" longitude="{{longitude}}" latitude="{{latitude}}"> </leaflet-marker>

    <leaflet-circle longitude="{{longitude}}" latitude="{{latitude}}"
                radius="{{mapRadius}}" color="#0a0" fillColor="#077">
    </leaflet-circle>
</leaflet-map>
// […]
updateCircle: function (e) {
    // this will always show only the initial location set, not the new one after dragging
    console.log(e.originalTarget.latitude, e.originalTarget.longitude);
}

nylki avatar Jan 27 '16 15:01 nylki