-
Notifications
You must be signed in to change notification settings - Fork 592
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 add draw on drawed feature? #1197
Comments
@maxiwer Hi, I can confirm that Here is what the code looks like: API reference |
@kumiko-haraguchi Is it just a layer? Where's the drawing tool's points? |
@maxiwer You can click the polygon and play with it in the same way as drawing it with the tool. |
I don't understand where I'm getting this wrong. Could you please review this:
and here I am trying to add kind of what you've wrote here:
What's wrong? |
@maxiwer Hi, it's hard to tell why your code isn't working from your code snippets. Would you be able to provide your code by using |
I'm getting the same error as the OP. Even the sample in the API doc won't work for me. No matter what I try (the Feature seems to be correct), I am getting: |
I tried to debug this, and it seems as if https://github.com/mapbox/mapbox-gl-draw/blob/main/src/api.js#L85 I am using mapbox-gl 1.x, since I am using it in combination with MapTiler and Urbica's react-map-gl implementation. Maybe map-gl-draw is not compatible with 1.x anymore? EDIT: I tested with mapbox-gl 3.x and am seeing the same results. |
@derwaldgeist @maxiwer I was getting the exact same error, but I got it working by ensuring that map has the draw control, before trying to call Example:
Works because |
@maxiwer @derwaldgeist I tried to reproduce the error by writing it in a Class but it seems to work fine for me...(confirmed with
@stepankuzmin Were you able to verify this bug? |
Hello mapbox-gl-draw team. How can I add a layer to draw object? I've tried this:
The text was updated successfully, but these errors were encountered: