You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to have a function to preload tiles, for example for use before a Map.flyTo over a large distance or through large zoom level differences as you'd otherwise just see large blank tiles.
Reacted by Pipoupi, Andrew Harvey, Lucas Wojciechowski, Ben McIntyre, Asdine El Hrychy, Felix Lange, Michiel van Roon, Håvard Lundberg, Arden de Raaij, JK and 26 more
Reacted by JK, Boris Cherny, Serhii Stotskyi, Michael Keller, Louis Grasset, jalMogo, Pim de Wit, Evan Purkhiser, Gabriel Jones, Yen Nguyen and 2 more
In addition, would be great if flyTo automatically preloaded tiles along it's flight path, in particular around its destination.
Reacted by Lucas Wojciechowski, Andrew Harvey, EJ Fox, Felix Lange, Michiel van Roon, Arden de Raaij, Boris Cherny, Adam, Marco Q, Maciej Ziarkowski and 14 more
changed the title [-][request] Add functions to allow for preloading tiles for a specified bbox and zoomlevel [/-][+]Add functions to allow for preloading tiles for a specified bbox and zoomlevel [/+]on Apr 25, 2016
changed the title [-]Add functions to allow for preloading tiles for a specified bbox and zoomlevel [/-][+]Preloading tiles for camera animation[/+]on Dec 8, 2016
Me too... have very blocky animation when flying around. Have changed zoom to 4 to fly at a higher level - presumably loading fewer tiles. But still pretty blocky (speed 1.2).
It's 2018 any update? I'd like to pre-fetch some tiles to display maps offline using webapp
Reacted by Alok Pepakayala, Louis Grasset, Théo champion, krisaoe, Daniele Arduini, Jesse Chase, Travis Anderson, Ben Wyss, Lloyd Atkinson, Michael Keller and 8 more
This would be a great feature. Using the flyTo for storytelling purposes and having a user maintain a sense of continuity is pretty unusable in its current state.
Reacted by Dániel Gergely, Blacki Migliozzi and Mats Miersen
This is definitely still something that we're interested in doing, and we can see that it would be very useful for storytelling-type animations. It's not on our near term backlog, so unfortunately we can't really say anything concrete about when we'll get to work on this. cc @chloekraw
Thanks for following up @ChrisLoer! In looking for a workaround, I had thought I could look at the network requests and preload those tiles on the client. But it seems that doing the same flyTo operation multiple times in the same session shows similar loading patterns. That is to say, it seems there's some kind of invalidation happening of tiles that were just loaded a moment ago — is that accurate? Is there a spot in the codebase you can point to where some of this logic is being handled? For those of us running into this issue, we could start digging into some possible solutions for our use cases.
@mhkeller The kind of central coordination point in the code for this logic is source_cache.js, but it's pretty complicated, it's hard to point to a single place. Here's the way we think of tile loading:
First, you load the vector tile from the network. Here, we rely on the browser's caching (and you can watch this in the network tab of the dev tools)
Second, we parse the vector tile on a web worker, apply the map's style, and turn it into a bunch of GL buffers ready for uploading to the GPU
Third, we transfer the tile to the foreground, upload to the GPU, and start rendering.
When we stop rendering a tile, the TileCache that you see in SourceCache is responsible for holding onto the "ready to render" tiles for a while so that we can quickly re-display them if they move back into the viewport. If the tile has been booted from the in-memory cache, then we have to redo the second (background) parsing step, and you'll see an empty tile on the map during that time.
Hi @skylarweaver, I ended up going the custom raster layer route. The other element that I found I needed for this to work well is the ability to load tiles from an arbitrary zoom levels decoupled from the camera's current zoom position.
With satellite imagery, it's distracting when the baselayer keeps changing. I wanted one stable image that I zoomed into and gradually got clearler and clearer. In my map (the first one in the story text where the yellow line is drawn), for example, the imagery at one zoom level was from winter while, at closer zoom levels, it was from summer. The change in tree cover was jarring.
I think it would be a great feature to be able to control zoom level and tile layer independently but I couldn't figure out how.
We've recently released a v2.7.0-beta.1, and it enables preloading tiles for camera animation. You can use preloadOnly option with any animation method:
Feel free to reopen this issue if you have any questions.
Reacted by Mike Hatfield, Peuquet and Trevor Hartman
Reacted by Pim de Wit, Tony Air, Mike Hatfield, Volodymyr Agafonkin, Marco, Michael Keller, Ben Ayre, Shane T. Geary, Victor Gerard Temprano, Louis Grasset and 1 more
We've recently released a v2.7.0-beta.1, and it enables preloading tiles for camera animation. You can use preloadOnly option with any animation method:
We've recently released a v2.7.0-beta.1, and it enables preloading tiles for camera animation. You can use preloadOnly option with any animation method:
Activity
kristfal commentedon Apr 21, 2016
+1
In addition, would be great if flyTo automatically preloaded tiles along it's flight path, in particular around its destination.
[-][request] Add functions to allow for preloading tiles for a specified bbox and zoomlevel [/-][+]Add functions to allow for preloading tiles for a specified bbox and zoomlevel [/+][-]Add functions to allow for preloading tiles for a specified bbox and zoomlevel [/-][+]Preloading tiles for camera animation[/+]havardl commentedon Jul 28, 2017
+1
Any updates on this?
bigrig2212 commentedon Aug 11, 2017
Me too... have very blocky animation when flying around. Have changed zoom to 4 to fly at a higher level - presumably loading fewer tiles. But still pretty blocky (speed 1.2).
silicakes commentedon Aug 14, 2017
Would love that as well
bcherny commentedon Sep 9, 2017
Any updates? The flash of grey makes a lot of animations totally unusable.
a2nt commentedon Mar 3, 2018
It's 2018 any update? I'd like to pre-fetch some tiles to display maps offline using webapp
travisanderson commentedon Jul 9, 2018
+1
boonstar commentedon Sep 29, 2018
+1
mhkeller commentedon Oct 19, 2018
This would be a great feature. Using the flyTo for storytelling purposes and having a user maintain a sense of continuity is pretty unusable in its current state.
ChrisLoer commentedon Oct 22, 2018
This is definitely still something that we're interested in doing, and we can see that it would be very useful for storytelling-type animations. It's not on our near term backlog, so unfortunately we can't really say anything concrete about when we'll get to work on this. cc @chloekraw
mhkeller commentedon Oct 22, 2018
Thanks for following up @ChrisLoer! In looking for a workaround, I had thought I could look at the network requests and preload those tiles on the client. But it seems that doing the same flyTo operation multiple times in the same session shows similar loading patterns. That is to say, it seems there's some kind of invalidation happening of tiles that were just loaded a moment ago — is that accurate? Is there a spot in the codebase you can point to where some of this logic is being handled? For those of us running into this issue, we could start digging into some possible solutions for our use cases.
ChrisLoer commentedon Oct 22, 2018
@mhkeller The kind of central coordination point in the code for this logic is
source_cache.js, but it's pretty complicated, it's hard to point to a single place. Here's the way we think of tile loading:When we stop rendering a tile, the
TileCachethat you see inSourceCacheis responsible for holding onto the "ready to render" tiles for a while so that we can quickly re-display them if they move back into the viewport. If the tile has been booted from the in-memory cache, then we have to redo the second (background) parsing step, and you'll see an empty tile on the map during that time.mhkeller commentedon Oct 22, 2018
Thanks that's super helpful! I'll see what I can do and update if I gain any wisdom.
The other option I'm thinking about is loading my own raster layer but that has it's own considerations. We'll see how it goes...
Thanks again.
skylarweaver commentedon Jul 10, 2019
@mhkeller @ChrisLoer Has there been any update on this feature request since 2018? Thanks!
mhkeller commentedon Jul 10, 2019
Hi @skylarweaver, I ended up going the custom raster layer route. The other element that I found I needed for this to work well is the ability to load tiles from an arbitrary zoom levels decoupled from the camera's current zoom position.
With satellite imagery, it's distracting when the baselayer keeps changing. I wanted one stable image that I zoomed into and gradually got clearler and clearer. In my map (the first one in the story text where the yellow line is drawn), for example, the imagery at one zoom level was from winter while, at closer zoom levels, it was from summer. The change in tree cover was jarring.
I think it would be a great feature to be able to control zoom level and tile layer independently but I couldn't figure out how.
Maybe @ChrisLoer has ideas or an update?
ewagstaff commentedon Apr 21, 2021
I know this has been a ghost issue for 2 years, but chiming in to say it would be a fantastic addition for storytelling continuity.
stepankuzmin commentedon Jan 26, 2022
Hey everyone 👋
We've recently released a v2.7.0-beta.1, and it enables preloading tiles for camera animation. You can use
preloadOnlyoption with any animation method:After the map finishes preloading, it becomes
idleso that you can start the animation:You can also achieve preloading tiles for an arbitrary region with:
You can get the example at ./debug/preload-tiles.html
Feel free to reopen this issue if you have any questions.
sedot42 commentedon Jul 26, 2022
@stepankuzmin I could not find it documented anywhere. I looked e.g. here. Am I missing something or is the documentation just missing for this one?
ibmeister commentedon Sep 16, 2022
Are we ever getting this for iOS?
vkaelin commentedon Sep 20, 2022
I can't see this API in v2.10.0, is it no longer available?
RoundRobin-fr commentedon Aug 2, 2023
sorry for necrobumping, but I can't get your example to work:
idleevent is firing immediately after thepreloadOnlycall is made, even though the preloading is not completed at all (barely started actually).matsmiersen commentedon Jun 18, 2024
it doesnt work
crunchwrap89 commentedon Jan 7, 2025
Same here, the idle event fires before the tiles are loaded which results in a laggy animation.
Anyone got ideas what the cause of this might be?