Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates polyline measurements on edit #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

olzraiti
Copy link

@olzraiti olzraiti commented Oct 16, 2020

Currently if you edit a polyline, the measurements don't update until you stop editing. The polygon edges update during editing, so this PR makes the plugin more consistent since the polyline behaves more like polygons.

You can reproduce the current behaviour by:

  1. going to the demo page https://prominentedge.com/leaflet-measure-path/
  2. Making the polyline editable by entering to console map._layers[39].enableEdit()
  3. Dragging the polyline corners doesn't update the polyline measurements

EDIT: Polygon doesn't update actually properly when editing, but rectangle does. I'll apply the fix for polygon also.
EDIT2: Polygon fixed now also

@juliogontor
Copy link

It works very well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants