-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
TileLayer improvements #4139
TileLayer improvements #4139
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.
Got interrupted, will add more comments soon...
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 feel that having classes named "Base..." should be avoided if at all possible. To me exposing abstract base classes is very technical, and associated with object oriented programming practices that are currently out-of-style (particularly in the JS community).
My preference would be to avoid the Base
name and call this TileLayer instead of BaseTileLayer
. Assuming that creates an unacceptable naming collisions (a layer with the same name in two different modules), happy to work on finding a more suggestive name.
I think this should still be in geo-layers
- just because we make layers work with non-geospatial coordinate systems does not mean they automatically get moved out of geo-layers, at least this should not be in the core layers module.
If the 2D loader is getting this complicated, I am starting to feel it could make sense to put the TileCache
code (which I want to call Tileset2D
) in loaders.gl. We can expand the 3d tiles
category to tiles
handle both 2D and 3D tiles...
There seems to be a lot of overlap in logic, support classes, testing logic etc.
As one example, we are going to need to add support for the RequestScheduler
from loaders.gl to this class as well, so there could be synergies by having this in loaders.
We just need to find a sub-module structure that makes sense to everyone.
| | | | | | | | ||
+-----------+ +-----+ +-----+-----+ | ||
|
||
show cached children tiles when parent is loading |
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.
Two way reuse, both up and down... This is not used by 3d tiles. Does this complicate things much?
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.
3d-tiles loads everything from the root to the current level, so the parent is always available when you zoom out. 2d only loads tiles at the current level. When you zoom out and no ancestors are available, the map will flash white and you lose all visual reference. Yes it adds complexity, but it's also needed for usability.
Regarding the I'm ok with this arrangement for now, given this non-geospatial support is new. In the long term, do we want to investigate non-geospatial support for 3d tiles (e.g. Potree is technically not bound to geospatial)? If so, we may want to move these two layers to a new module |
6abe858
to
720f23d
Compare
Resolves #3511
This PR refactors
BaseTileLayer
/TileCache
classes to function more similar toTile3DLayer
/Tileset3D
. Traversal now reruns every time any tile finishes loading, instead of waiting for the entire viewport to load. The logic that determines tile visibilities is entirely moved intoTileCache
. It also uses a more sophisticated strategy (configurable by the user) to pick placeholders when a tile is pending.The new API needs audit.
Change List
strategy
prop toBaseTileLayer
(see documentation)TileCache
rewrite