Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Tile source max/min zoom is ignored by tile pre-cacher #1416
Description and/or steps/code to reproduce the problem
The MapTilePreCache class will attempt to pre-cache tiles from a tile source at zoom levels that the tile source does not support (as specified by its min/max zoom levels). This results in a lot of unnecessary requests being made by the library.
Is this behavior perhaps intentional? I'm currently hacking it out by checking the zoom level myself in the source's
This was seen with a custom tile source but should also be present with any tile sources that don't disable the pre-cacher with the FLAG_NO_PREVENTIVE policy flag.
You can most easily see this by enabling the DebugMapTileDownloader (
If it's a bug, version(s) of android this affects:
Version of osmdroid the issue relates to:
New class: * `SampleUnreachableOnlineTiles`: demo checking if the zoom restriction for tiles is correctly applied, to be found under "More Samples / Tileproviders / Zoom Restricted Online Tiles (14-15)" Impacted classes: * `MapTileApproximater`: called new method `TileLoader.loadTileIfReachable` instead of `TileLoader.loadTile` * `MapTileModuleProviderBase`: new method `isTileReachable`; new method `TileLoader.loadTileIfReachable`, to be called instead of direct calls to `TileLoader.loadTile` * `MapTilePreCache`: called new method `TileLoader.loadTileIfReachable` instead of `TileLoader.loadTile` * `SampleFactory`: added new demo `SampleUnreachableOnlineTiles`