-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Offline raster tiles does not use correct zoom level #9563
Comments
This is not related to offline packs. I do not use offline packs. The tiles got into the database without using offline packs. |
Looks like I have a similar, but less visible problem with vector tiles. |
This might be a duplicate of #9493, but that one is closed as a dup of som offline pack case. I do not use offline packs. |
My guess is it's caused by #7741. cc @tmpsantos |
Tried now. The current state of #9468 does not fix this problem. Hopefully it will in the future. |
Ok, reopening so we can investigate. |
In this case, it looks like my offline tiles are expired. So it first draw the old one, then tries to fetch a fresh tile and then when the network is down the download failes and it jumps to z-1. It should probably use the tile in the database in this case even when it has expired. Does this make sense? |
I worked around this issue by making sure that the offline tiles that I insert into the database has a expire value in the future. That seem to prevent mapbox from attempting to refetch the expired tiles in offline mode and then failing resulting in jumping to z-1. |
We had something like this before, but it was fixed by e962b79 |
I seem to be experiencing this issue also. Here's a video of what I'm seeing: https://www.dropbox.com/s/p89hb976d9qha5g/offline-raster-map-issue.mov?dl=0 This video shows the following:
As you can see in the video, it appears that the offline tiles load correctly for a brief moment, and then the map cycles through tiles from lower zoom levels until it just renders blank tiles. I'm not sure if this matters, but I'm hosting raster tiles on my own server, with the following style. (Note that the listing below omits the full tile URL.)
As mentioned by @halset, the log is outputting a lot of messages like this:
|
I tried previous versions of the iOS SDK and found that this issue does not occur when using v3.5.4, but does occur starting with v3.6.0-alpha.1. |
@namannik Could it be that your tile provider does not have an Expires http header? And that the tiles are inserted in the tiles-table with null value in the expires column? Are you able to change the tile provider so that an Expires-header are included with the tiles? |
Thanks, @kkaefer. I've rolled back the SDK used in my app to v3.5.4, so I'll be good for now. @halset The server hosting the tiles is one that I set up, and I didn't set it to provide an "Expires" http header. (I wasn't aware this was necessary.) I can give that a try. As for how the tiles are inserted into the tiles table, I'm using Mapbox's built-in |
Looking forward to the fix, @kkaefer 👍 Thanks! @namannik The Expires http header should not be required. During tile fetching, some of the http headers are stored with the tiles. When offline, the tile is first fetched from the database. As the tile has expired (Expires is missing), it is refetched in the background. And when that failes, it jump to the z-1 tile and so it goes. So setting the Expires header can be a workaround for this issue. This is at least how it looks for me. |
@kkaefer It is working very well. Thank you! |
Platform: iOS
Mapbox SDK version: master as of f19c36a
Steps to trigger behavior
Expected behavior
The best tiles available at any place are shown.
Actual behavior
When zooming in, first the best tiles are shown. Then the map gets more and more blury as the view shifts to showing less and less detailed tiles.
In the console, lots of messages like this are shown:
(The above gif show wifi and cell coverage dots, but those are turned on by QuickTime. This is really offline mode.)
The text was updated successfully, but these errors were encountered: