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

how to snap other layer on the map #3

Open
hu-bobo opened this issue Jun 21, 2022 · 4 comments
Open

how to snap other layer on the map #3

hu-bobo opened this issue Jun 21, 2022 · 4 comments

Comments

@hu-bobo
Copy link

hu-bobo commented Jun 21, 2022

No description provided.

@mhsattarian
Copy link
Owner

Currently, it's only possible to snap to features added to mapbox-gl-draw. add as in Draw.add or Draw.set.
I assume you can add features currently available to the viewport to Draw as well to get the snap behavior.

@alexcroox
Copy link

alexcroox commented Sep 4, 2023

I'm looking for this too, I wonder if it's possible to add the existing polygons to Draw but make them readonly as I don't want them to be editable, just used in snapping considerations.

One possibility: https://stackoverflow.com/a/66009522/241465

@mmorley0395
Copy link

This would be a nice feature but I can see how implementing it would be tricky. I have a giant layer (sidewalk data for a region) that would be nice to snap to, but unwieldy to move into Draw.

@dh-jburke
Copy link

+1 on this, would be a very useful feature to list out the sources or layers that new features should be snapped to.

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

5 participants