Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to drag existing markers to a new position?
Is it possible to drag existing markers to a new position?
Comments
Comment #1
jweirather CreditAttribution: jweirather commentedDid you ever find any feedback/solution for this?
Comment #2
jweirather CreditAttribution: jweirather commentedQuick hack: insert "
, draggable: true
" to the sites/all/modules/leaflet_widget/js/widget.js file on the line that creates the marker. Line 70 in my version. Like so:{ marker: new L.Marker(latlng, { icon: map.drawControl.handlers.marker.options.icon, draggable: true }) }
*disclaimer: If you use this method, you need to understand that this is a hack, may cause [unknown] problems, and WILL almost certainly be overwritten by future updates to this module. This hack is offered only as a quick fix, it is not a proper solution for this issue. It is meant only as a stop-gap for users needing this feature immediately.
It is working for me on desktop and tablet.
"Draggable", as well as other marker options, would be a fantastic addition to this module.