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

Editing a polygon that has been added to map with draw.add has some odd lagging behaviour. #777

Closed
jackwkinsey opened this issue May 8, 2018 · 2 comments · Fixed by #769

Comments

@jackwkinsey
Copy link

jackwkinsey commented May 8, 2018

I've encountered some strange behaviour with editing a polygon. It seems to be tied to having the draw mode "initialized" with "draw.add". When you try to edit the polygon and drag a vertex, it is never "cleared" from the frame and is layered on the last frame so you see bunch of vertices layered while dragging around.

Dragging a vertex

mapbox-gl-js version: 0.44.2
mapbox-gl-draw version: 1.0.4

Steps to Trigger Behavior

  1. Navigate to https://codepen.io/jackwkinsey/pen/odoJJV?editors=0010
  2. Enter your Mapbox API Access Token at the top to make the code run.
  3. You should see polygons for Brazil.
  4. Double click on one of the polygons to allow it to be edited.
  5. Drag one of the vertices.

OR

Steps 1-3: Same as above.
4. Click on the "Create Polygon" button in the top-right corner.
5. Draw a new polygon, this is added to the Brazil set of polygons.
6. Double click on your new polygon to allow it to edited.
7. Drag one of the vertices.

Expected Behavior

The polygon should be able to be edited freely and smoothly.

Actual Behavior

The vertices and the polygon are never "redrawn" and "cleared" so you see a jagged bunch of vertices bunch up until you release and click off of the polygon.

@jackwkinsey jackwkinsey changed the title Editing a polygon that has been added to map with draw.add has some add lagging behaviour. Editing a polygon that has been added to map with draw.add has some odd lagging behaviour. May 8, 2018
@mcwhittemore
Copy link
Contributor

Thanks for the issue @jackwkinsey. The problem here is that Draw does not correctly support numeric ids. If you can confirm #769 fixes your problem, I can merge that PR and get this out the door.

@jackwkinsey
Copy link
Author

I mentioned this on the other thread that you linked to, but yes it looks like this fix will solve my issue as well.

We were using the CDN version of mapbox and mapbox draw. Any idea on how long this fix would take to get into CDN?

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 a pull request may close this issue.

2 participants