mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.19k stars 2.22k forks source link

Improve 'perceived performance' by preloading lower zoom level tiles #2826

Open liebrand opened 8 years ago

liebrand commented 8 years ago

A number of my users have complained that things "feel" slow and "blocky" when panning around. Basically, as they drag-pan around on their phones, they see a lot of white blocky tiles being loaded. Much more so than google maps.

Initially, I thought I should try and increase the viewport. Not sure about the terminology here, but basically make sure more neighbouring tiles are preloaded. However, I think that quickly leads to 'how long is a piece of string'. And after a bit more digging, I think there is a better and easier solution to this perceived performance.

Rather than loading more neighbouring tiles at the current zoom level, we could preload (and render!) the lower zoom level tiles. That way, when drag-panning, you would not see any white unloaded tiles. Instead you'd see details from the lower zoom level, which would gradually improve quality as the tiles at the current zoom level are loaded.

So if we are at zoom level 12, we could/should load the tile at those coordinates for level 11 (and maybe even 10, 9, etc - so that if the user does a quick zoom out pinch gesture, they still dont see unrendered tiles).

This should make a significant improvement on 'perceived' performance.

jfirebaugh commented 8 years ago

We actually just recently implemented this feature. See #123.

liebrand commented 8 years ago

That sounds great; although the issue you linked to is one from three years ago and I can't really see how it's related?

liebrand commented 8 years ago

I just upgraded to 0.20.1 but I still see white blocky tiles as i pan and zoom out. Can you point me to the commit/pull-request where this was implemented? Then I can check if it ought to be in 0.20.1

jfirebaugh commented 8 years ago

Oh, sorry, I got my repositories mixed up. We implemented this feature in mapbox-gl-native (for desktop and mobile SDKs), but you are requesting it for Mapbox GL JS.

liebrand commented 8 years ago

Ah that explains it; yes for the JS version. Out of curiousity, how many lower zoom levels do you preload for native? Just the one, or several?

liebrand commented 8 years ago

Friendly ping; is there any plan to implement this for JS as well?

mollymerp commented 8 years ago

hi @liebrand thank you for the feature request. this feature is worthwhile but we don't have a specific timeline for building it out at this time. we would gladly accept a PR implementing this though!

tzvc commented 6 years ago

@mollymerp Is there any updates on this ? 👍

asheemmamoowala commented 5 years ago

Native implementation in: https://github.com/mapbox/mapbox-gl-native/pull/5143

jliebrand commented 5 years ago

Hi guys,

I was looking at something today and stumbled across this again. Wondering if there has been any update on this?

Seems like such an easy win to really make things "feel much smoother"?

jliebrand commented 4 years ago

Friendly ping... original issue is now almost four years old. Any chance of this happening?

jliebrand commented 4 years ago

Ping.... pong....

msschl commented 3 years ago

I'm interested in this feature. Any news on this?