leaflet / path.drag.js Goto Github PK
View Code? Open in Web Editor NEWAdd dragging capability to Leaflet paths.
Add dragging capability to Leaflet paths.
Please publish this package on bower.
I'm grouping some draggable markers in a layer in order to be able to hide/show them at once with the leaflet built-in control for overlays.
The markers are draggable all right at first, but as soon as the layer has been hidden and shown again using the control checkbox, then trying to drag a marker will move the whole map.
Minimum example to reproduce:
var myLatLng1 = L.latLng(48, 5);
var myLatLng2 = L.latLng(48.1, 5.1);
map.setView(myLatLng1, 11);
var myMarker1 = L.circleMarker(myLatLng1, {draggable: true});
var myMarker2 = L.circleMarker(myLatLng2, {draggable: true});
var myLayer = L.layerGroup([myMarker1, myMarker2]);
myLayer.addTo(map);
L.control.layers({}, {'My layer': myLayer}).addTo(map);
I'm experiencing this with both leaflet 1.3.4 and 1.4.
If you drag the map, the path is being reset to the origin point.
I am trying to implement this using Leaflet.Draw, but its not working totally correct.
I am moving the polygon to the left in this case, but the boundary markers are staying put. (marked them with grey color) When i press Save, only then they get updated, and are located to their new place when i edit the polygon again.
Have you ever tried it with Leaflet.Draw ?
Thanks
It would be super nice to be able to select which mouse button can drag the path.
In my application I want to be able to rotate objects with right-click, which results in an interesting behavior when right-clicking into a path. It rotates and moves the path at the same time.
I suppose this lib has a dependency to leaflet v1.0+
. I had a lot of trouble make this work with version 0.7
and repeatedly got error:
TypeError: Cannot read property 'getRenderer' of undefined
please add specific leaflet version to dependencies or state the version this lib supposed to work alongside.
I'm toggling the visibility of a featureGroup
using removeLayer()
and addLayer()
.
But after a toggle, dragging is no longer working. I can still edit the points of a polyline, but dragging is not working.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.