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

draw.changeMode('direct_select', feature_id) not rerendering properly #738

Closed
mrshll opened this issue Jan 28, 2018 · 5 comments · Fixed by #769
Closed

draw.changeMode('direct_select', feature_id) not rerendering properly #738

mrshll opened this issue Jan 28, 2018 · 5 comments · Fixed by #769

Comments

@mrshll
Copy link

mrshll commented Jan 28, 2018

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

Steps to Trigger Behavior

feature is an immutable Map.

const draw = new MapboxDraw({
  displayControlsDefault: false,
  controls: {
    polygon: true,
  },
});
map.addControl(draw);`
draw.add(feature.toJS());
draw.changeMode('direct_select', {featureId: feature.get('id')});

Drag one of the feature's vertices.

Expected Behavior

Allows editing of the polygon and when vertices are dragged it renders the updated geometry on each frame.

Actual Behavior

Old frames are not cleaned up and the geometry is "smeared" across the movement path.

example

@george-silva
Copy link

seeing the same behavior here. same versions!

@OskarHeden
Copy link

We had the same problem with MultiPolygons but it turned out to be because our id was an int instead of a string, I don't know if this is relevant here though.

@mrshll
Copy link
Author

mrshll commented Apr 25, 2018

! That solves it. @OskarHeden thank you.

So perhaps this should be a bug to properly handle integer ids, or to return an error when ids are integers.

@george-silva
Copy link

You mean the feature id?

@mcwhittemore
Copy link
Contributor

Oh! Wow. That is most definitely a bug.

If a Feature has a commonly used identifier, that identifier SHOULD be included as a member of the Feature object with the name "id", and the value of this member is either a JSON string or number.

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.

4 participants