Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Switch to mirrored duplicate source technique to increase performance of hover/highlight user interactions #258

Closed
ryanbaumann opened this issue Nov 4, 2018 · 2 comments

Comments

@ryanbaumann
Copy link
Contributor

ryanbaumann commented Nov 4, 2018

Problem

Hover/Highlights can be slow to react to user input because setFilter is slow, specifically mousemove events.

Solution

The ideal solution would be to use featureState for all user interactions - which we can do for Geojson sources used in Circle, Heatmap, and Cluster layers.

Since feature id values cannot be enforced easily for Choropleth layer Vector Tile sources, instead of featureStates we can consistently use the mirrored source technique to increase hover / highlight performance. See mapbox/mapbox-gl-js#2874 (comment) for details on how this technique works.

Outcome

Better user experience interacting with and filtering data in the Mapbox Visual.

cc/ @samgehret

@ryanbaumann ryanbaumann changed the title Switch to mirrored duplicate source technique to increase performance of hover/highlights Switch to mirrored duplicate source technique to increase performance of hover/highlight user interactions Nov 4, 2018
@ryanbaumann
Copy link
Contributor Author

ryanbaumann commented Nov 30, 2018

We can evaluate using the new validate: false flag for setFilter in Mapbox GL JS 0.52.0 (currently in beta) to see if it's an easier implementation to address this issue.

@ryanbaumann
Copy link
Contributor Author

Closing in favor of #286

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant