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

Fix removeFeatureState bug #8087

Merged
merged 1 commit into from
Mar 27, 2019
Merged

Fix removeFeatureState bug #8087

merged 1 commit into from
Mar 27, 2019

Conversation

asheemmamoowala
Copy link
Contributor

Closes #8026.

Feature state is applied only to those features identified by an id that have state set. The removeFeatureState method, when called to clear state on all features in a source/source-layer, didn't clear the state of each feature, it cleared all the state for that source. i.e. { idA: {..}, idB:{...} } became {} instead of { idA: {}, idB: {}}.

This PR fixes this by preserving the feature id that have had state applied previously, and clearing out that state. This allows the empty state to be applied to tiles that are being 'refreshed' when restored from the cache.

Benchmark results Screen Shot 2019-03-26 at 10 05 41 PM Screen Shot 2019-03-26 at 10 03 47 PM Screen Shot 2019-03-26 at 10 04 08 PM Screen Shot 2019-03-26 at 10 04 18 PM

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • post benchmark scores
  • manually test the debug page

cc @peterqliu @kbauhaus

… the feature object. This allows updating the buffers for features whose state has been removed, but also requires keep track of previously removed features.
Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Contributor

@peterqliu peterqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, and good new test to check for changing zoom levels 👌

@asheemmamoowala asheemmamoowala merged commit 008bc84 into master Mar 27, 2019
@kkaefer
Copy link
Member

kkaefer commented May 3, 2019

Does this need porting to Native?

@asheemmamoowala
Copy link
Contributor Author

asheemmamoowala commented May 3, 2019 via email

@mourner mourner deleted the fix-8026 branch August 1, 2019 11:46
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 this pull request may close these issues.

removeFeatureState does not remove state from the original zoom level
4 participants