This article is a somewhat technical overview of how maps and map downloads work in Gaia GPS. Gaia GPS supports viewing multiple map types, both online and offline.
What Type of Maps Are We Talking About?
Maps in Gaia GPS come from a number of providers, and we also make some maps in-house.
Most of the maps in Gaia GPS are "raster" maps cut into "tiles". Raster means the map is made of pre-made images, often different images for different zoom levels. Tiled means the map is cut into many small squares (for performance reasons).
There are several pieces of information that go into defining a map source:
- Minimum and maximum zoom levels that the map provides
- A bounding box for the region the map covers (defined by the Northeast and Southwest corners of a box that contains the entire map)
- A URL where the tile lives on the internet
- A name and description
- A unique identifier used in the App
How Map Downloads Are Stored
Maps in Gaia GPS are stored in two different places: the temporary cache folder and the My Files Folder. Each Map Source has its own download folder and temporary cache folder. It's important that each Map Source has exactly one download folder. Multiple copies of the same tile are never stored in the My Files Folder. As you browse the map, Gaia GPS first checks if a tile is available in the My Files Folder, then the temporary cache. If the tile is not available in either of those places, the app requests it from the internet. If the tile is successfully fetched from the internet it is stored in the temporary cache.
The temporary cache can grow quite large when panning around the map. It can be manually cleared from the app's Settings menu if you are running low on storage. When the app is launched, it checks if the temporary cache contains more than 100,000 tiles. If it does, the 10,000 least recently used tiles are deleted.
Gaia GPS supports downloading maps for offline use . Areas of the map that are frequently browsed will likely be in the temporary cache, but in order to guarantee that maps will be available offline they should be downloaded.
Each map download record contains several pieces of information:
- The map source the download refers to; The minimum zoom level to be downloaded; The maxium zoom level to be downloaded; The northeast and southwest corners of the region to be downloaded
- The number of tiles remaining to download
- A name, date, and description for the download
When a Map Download is deleted, a similar process happens as when it was downloaded. A list of tiles is generated, then each tile on the list is checked to see if any other Map Downloads need it, and if they don't it is deleted. If you have two downloads from the same Map Source and region, and delete one of them, no tiles will actually be deleted. When the remaining download is deleted all the tiles will be deleted.
Auto Resuming Downloads
One of the options in the Map Downloads section of the Settings menu is "Auto Resume". With this enabled, the app will check for incomplete downloads at launch, and resume them. Only map downloads that were created on the device will be auto-resumed. Downloads received by GaiaGPS.com sync will never be auto-resumed, they must be manually resumed.