Skip to content

Cannot set marker.draggable to false #256

@skalb

Description

@skalb

Toggling marker.draggable between true/false doesn't seem to work.

I debugged through and the offending line seems to be:

// Update the draggable property
if (markerData.draggable !== true && oldMarkerData.draggable === true && marker.dragging === true) {
  marker.dragging.disable();
}

Specifically, marker.dragging === true will always return false since dragging is an object.

I changed this to (marker.dragging !== undefined && marker.dragging !== null) and it seemed to work.

If this looks right, let me know and I'll submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions