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

Adding a layer to its own list of guide layers breaks snapping for that layer #37

Open
rawbeans opened this issue Jul 27, 2016 · 1 comment
Labels

Comments

@rawbeans
Copy link

If you do the following:

 layer.snapediting.addGuideLayer(layer);

layer will no longer snap to any other guide layer because layer is always the closest guide layer to itself.

Obviously you can check if a layer is equal to the layer you are adding it to, but it might be a good idea to check for this within the library. It is never desirable to have a layer within its guide layer array because it breaks snapping, so might as well prevent it from ever happening.

@bastyen bastyen added the bug label Aug 18, 2016
@haoliangyu
Copy link
Contributor

This has been fixed by #30, where I add a function (source) to detect whether a guide layer was the editing layer itself (then skip it). I don't remove a layer from its guide group because it make it possible to use the same feature group with the L.EditToolbar.SnapEdit.

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

No branches or pull requests

3 participants