Skip to content

Commit

Permalink
Fix Circle Drag Bug (#623). Fixes #617 (patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
Falke-Design committed Jul 17, 2020
1 parent b2a4d3e commit aa5cf88
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/js/Mixins/Dragging.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ const DragMixin = {
return false;
}

if(this._layer instanceof L.CircleMarker) {
this._updateHiddenPolyCircle();
}

// timeout to prevent click event after drag :-/
// TODO: do it better as soon as leaflet has a way to do it better :-)
window.setTimeout(() => {
Expand Down Expand Up @@ -185,8 +189,10 @@ const DragMixin = {
});

if (this._layer instanceof L.CircleMarker) {
// create the new coordinates array
const newCoords = moveCoords([this._layer.getLatLng()]);
// set new coordinates and redraw
this._layer.setLatLng(latlng);
this._layer.setLatLng(newCoords[0]);
} else {
// create the new coordinates array
const newCoords = moveCoords(this._layer.getLatLngs());
Expand Down

0 comments on commit aa5cf88

Please sign in to comment.