-
Notifications
You must be signed in to change notification settings - Fork 2k
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
HexagonLayer: Aggregate data using valid viewport. #2196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that this bug is a result of all the refactorings we have done to support multiple viewports.
I have a feeling that this PR mainly works around the real problem (viewport initially being undefined).
If that was fixed, would we still want to reaggregate when the viewport is changed? Wouldn't that turn this into a ScreenHexagonLayer
?
Are the results of the aggregation actually viewport dependent (lng/lat/zoom) or do we just need a mercator projection? If the latter, can we just create a "working viewport" during aggregration (instead of depending on the passed in viewport)?
return ( | ||
oldProps.radius !== props.radius || oldProps.hexagonAggregator !== props.hexagonAggregator | ||
changeFlags.dataChanged || | ||
changeFlags.viewportChanged || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get viewportChanged
notifications, I think you need to define the shouldUpdateState
method.
It uses viewport for 1. calls So if any change in above factors, we should re-aggregate. |
Digged more into this
For hexagon layers, we do need to re-project points at #4 , so we have to check for |
Update the PR with possible solution (couple of tests failing, will fix before landing them) We need to project points the first time viewport changed to a geospatial (WebMercatorViewport) viewport, since initial viewport is not a WebMercatorViewport. Added changes to aggregate only when layer has geospatial viewport and |
* Revert "HexagonLayer: Aggregate data using valid viewport. (#2196)" * Comment out unused import
* Reenable "HexagonLayer: Aggregate data using valid viewport (#2196)"
* Reenable "HexagonLayer: Aggregate data using valid viewport (#2196)"
For #2111
Background
Re-aggregate and update hexbins when viewport is changed.
Change List