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

Make length of polygon not editable #143

Open
ajuliano opened this issue Aug 11, 2017 · 2 comments
Open

Make length of polygon not editable #143

ajuliano opened this issue Aug 11, 2017 · 2 comments

Comments

@ajuliano
Copy link

We are building a feature where our users shouldn't be able to edit the length of the polyline that are created. However they should be able to move the two endings of the polyline, but not be able to make the polyline longer or shorter. Is that possible to do?

We are using skipMiddleMarkers: true. The polyline starting and ending point of the polyline below:

var latlngs = [
    [56.043191, 12.710583],
    [56.043413, 12.711087]
];
var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
polyline.enableEdit();
@yohanboniface
Copy link
Member

Isn't it that you only need https://github.com/Leaflet/Path.Drag.js ?

@ajuliano
Copy link
Author

Thank you. We also need to be able to change the angle between the ending and starting point. Is that possible with Drag?

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

No branches or pull requests

2 participants