Skip to content

Fix removeFeatureState bug - #8087

Merged
asheemmamoowala merged 1 commit into
masterfrom
fix-8026
Mar 27, 2019
Merged

asheemmamoowala merged 1 commit into
masterfrom
fix-8026

Conversation

@asheemmamoowala

Copy link
Copy Markdown
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.

@ansis ansis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

@peterqliu peterqliu left a comment

Copy link
Copy Markdown
Contributor

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

kkaefer commented May 3, 2019

Copy link
Copy Markdown
Member

Does this need porting to Native?

@asheemmamoowala

asheemmamoowala commented May 3, 2019 via email

Copy link
Copy Markdown
Contributor Author

@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