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

Add an A/B layer feature #1046

Open
manthey opened this issue Nov 15, 2019 · 1 comment
Open

Add an A/B layer feature #1046

manthey opened this issue Nov 15, 2019 · 1 comment

Comments

@manthey
Copy link
Contributor

manthey commented Nov 15, 2019

When changing URLs in tile layers, it is often handy to have two layers where one is hidden loading the new url. When the hidden layer is fully loaded, the two layers' visibility is swapped. This can be done where multiple changes to the url always affect the hidden layer (delaying any change in view) or are queued so that intermediate changes are visible.

This could be done in an abstract manner where the A/B buffered layer could be any layer type. Only specific calls would be buffered; all others would affect both layers equally. The two layers would always be adjacent in the z-stack and would not be eligible to share rendering contexts with other layers.

@manthey
Copy link
Contributor Author

manthey commented Nov 3, 2020

For tile layers, having a single layer where the tiles suddenly swap would be preferable. Specifically, we rate limit concurrent tile requests to six per domain, and, if both urls are from the same domain, it would be good to share this throttle. Further, the switch should occur as soon as all required tiles are available (not all tiles in the queue). With a single layer, you would have a shown url, a target url (not necessarily the same), and, possibly, a secondary url (so if you are switching A-B-A, you don't need to refetch all of the A tiles if they haven't fallen out of memory). If the tile cache includes the url, then perhaps maintaining the secondary url become superfluous.

If the shown url and target urls are different (because the target isn't loaded enough to switch), and navigation occurs requiring different tiles, I think we'd want to load the shown url tiles faster than getting ready to switch to the target url. If the target is updated before it is ready, naturally some tiles will have been loaded without ever being shown.

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

No branches or pull requests

1 participant