Skip to content

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

@nylki

Description

@nylki

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions