Is it possible to drag existing markers to a new position?

Comments

jweirather’s picture

Did you ever find any feedback/solution for this?

jweirather’s picture

Quick 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.