Offline first for tile download
See original GitHub issueIssue Type
- Improvement
- Performance
Description and/or steps/code to reproduce the problem
The process in order to get the tiles works more or less that way:
- we have an ordered list of providers
- some are embedded (zip files, SQLite)
- some are on the internet
- at least one provider is an approximation (
MapTileApproximater
) - and we try to find the tile bitmap from this ordered list of providers - and when we find it we don’t check the following providers
Problem: assuming we don’t have the tile in our embedded providers and assuming we have a low connectivity, we will be waiting during the tile downloading, and in the meanwhile we display nothing. If we had no connectivity at all, then we would immediately skip the download provider and display the tile provided by the approximation provider.
The solution would be something like:
- putting the embedded and approximation providers first in
MapTileProviderBasic
(as “offline”) - when we find the tile in those providers, if the tile is up to date, this is it
- if we found a downgraded version of the tile (expired or approximated), we display it but we keep looking for it in the next providers of the list (presumably “online”)
- doing so we display immediately an approximation of the tile, while searching for a better version online
Environment
Version of osmdroid the issue relates to:
6.0.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:27 (7 by maintainers)
Top Results From Across the Web
How to download tiles to use offline - GIS Stack Exchange
First you need to figure out how this map tiles need to be organized. There is the Tile map service standard that describes...
Read more >Build an offline-first app - Android Developers
An offline-first app is an app that is able to perform all, or a critical subset of its core functionality without access to...
Read more >Download an offline map (ahead of time) - ArcGIS Developers
Users can download the offline maps quickly and with minimal interaction. ... This creates a set of data files such as tile packages,...
Read more >Offline maps | Help - Mapbox docs
The offline tile update process is the same process as with regular map tiles: The map tile's only downloaded if there's a new...
Read more >Individual Offline Map Tile Limits - Gaia GPS
Thanks for the tip, @Nathan . The suggestion you provided was my first process. However, in order to download all the necessary Maps...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@InI4 I’ll work on that after the next release (6.1.0). Btw:
What I had in mind is:
And regardless of that initial order or reorder aspect, the process will be:
@InI4 More or less, but it don’t know if we can be specific about “in database” or not: we’ll let the user set its own tile providers list order. The order is currently “best providers” first; the goal is “fastest providers first”, while still looking for an up-to-date tile. Can we enforce the provider list order? To do that we’ll need to know for each provider its tile relevancy (expired / scaled / up-to-date) and its access speed (local database / local file / network / notoriously slow server). Then we can add a method in the provider array, something like “reorder according to relevancy or speed”.