Closed brandonxiang closed 8 years ago
Humm, but the offset
is then computed with event coordinates, I'm not sure this will work.
Can you be clearer in how to reproduce the issue?
Maybe setting up a minimal example in http://playground-leaflet.rhcloud.com/ ?
No problem.
http://playground-leaflet.rhcloud.com/ner/2/edit?html,output
All this problem is discussed in the L.canvas condition.
If I drag the triangle first, the triangle is draggable as usual.
However, if I move the map first, then the triangle will become undraggable. Only the map is moved.
OK, got it, thanks! Fix sounds good, but you then should also update here https://github.com/Leaflet/Path.Drag.js/pull/4/files#diff-50ed3b9a9a28a38d8a12041bc4d297daR69 to compare points on same reference.
On the condition of
preferCanvas
in Leaflet 1.0, after I moved the map viewer, the dragging capability became disable.I found out that the bug is caused by the error of
this._startPoint
in Line 21 ofPath.Drag.js
A conversion is needed for the coordinate transformation from sreen coordinate to map layer coordinate.
Therefore, it should be replaced by
this._path._map.mouseEventToLayerPoint
.