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

Tile load order #115

Open
rafaqz opened this issue Dec 22, 2024 · 2 comments
Open

Tile load order #115

rafaqz opened this issue Dec 22, 2024 · 2 comments

Comments

@rafaqz
Copy link
Collaborator

rafaqz commented Dec 22, 2024

I've been going over the code and why the mouse focus loading isn't working properly

It might be good to clarify what the best tile loading order is and why, so I will try to lay out what I think it is here for discussion.

My strategy previously was loading the lowest resolution first is the best way to get something on the screen immediately. There is not much point loading lower resolution tiles than the z level where where 1 tile could cover the whole area (but wont always so it's 1-4 tiles). But loading more zoom levels out is not that expensive either.

First load the visible area from low res to high and form the mouse cursor out, so:

  • The tiles at the zoom level that could cover the whole view area (1-4 tiles)
  • The tile under the mouse cursor at the next zoom level out
  • The ring of tiles around that tile
  • the ring that is at the edge of the visible area
    ... Repeat for zoom levels and rings up to the current zoom level
  • The tile under the cursor at the current zoom level
  • Concentric rings around the mouse position the current zoom until the visible area is covered

After loading visible tiles, load a halo around the visible area so that panning and zooming
doesn't cause flashing white artifacts. The order doesn't matter as much but probably low res first is best here too

  • The outer halo (not shown in the plot) of the furthest out zoom in the range
    ... Repeat for outer halos to the current zoom level
@asinghvi17
Copy link
Member

This makes sense, your resolution will never be big enough that this is truly harmful. But IMO we could probably drop a lot of the intermediate zoom levels, maybe make a hard limit of 3 intermediate zoom levels for truly large plots.

@rafaqz
Copy link
Collaborator Author

rafaqz commented Dec 22, 2024

I'm not sure I understand this reasoning. It doesn't save much to cut intermediate layers, as the main layer is always 3x more tiles than all the other layers combined.

And the effect of the area you are looking at getting better resolution as quickly as possible will make it seem faster to load the intermediate levels than to jump straight to the desired level its more about perception than download counts. Skipping levels means you really do need to wait to see much detail in the whole image. Google earth loads all the levels.

But these are details. The main problem is the current code is doing the opposite of this. Background tiles are loaded last rather than first, and the rings around the mouse do not work at all.

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

2 participants