Topic: Caching tiles...how does it work?

I built script to crawl over an area of the map at multiple zoom levels in order to download all tiles for offline caching (my app will always work offline so I want all tiles in the region of interest downloaded).

I run my scanner and the click "Cache tiles to Resources", and this works. However, if I repeatedly run the scanner it will find more new tiles every time. I don't even see any blank/gray areas on my map, but every time I run a new scan of the exact same region, it downloads more tiles (not changes, but adds NEW files). I was hoping to get to a point where I was certain all tiles in the area of interest are downloaded. How can I be certain it has completed grabbed a region?

Re: Caching tiles...how does it work?

Hi.

Cache tiles to Resources checks which tiles are currently loaded and saves them to Resources.
There could be many reasons why this adds new tiles every time, for example:
- you click a button on different locations or zoom.
- you reached that location by different paths.
- some tiles haven't had time to load yet or have already had time to unload.

If you want to download an area, it is better to use TileDownloader:
https://forum.infinity-code.com/viewtop … 4612#p4612

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

3 (edited by daniel.o.farrow 2025-08-29 15:21:23)

Re: Caching tiles...how does it work?

Thanks for the script. I am using v3.8 with Bing maps. It seems to partially work, it downloads some tiles...but once I get to the deeper zoom levels (like 15+) I just get constant errors about the downloaded JPG being zero bytes. The requests come back with a 200 (OK) response from the server, so I am not sure what is happening.

I tried google APIs and it download a bunch under the 16 zoom level and below, but once it got to level 17 I was getting this for all requests:

REQUEST:
https://khm0.googleapis.com/kh?v=1000&a … 2&z=17

RESPONSE:
{
  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "status": "NOT_FOUND"
  }
}

Re: Caching tiles...how does it work?

Most likely the Bing Maps servers are configured to always return a 200 code instead of 404 for missed ones.
Just add a data size check to the script.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

5 (edited by daniel.o.farrow 2025-08-29 15:27:06)

Re: Caching tiles...how does it work?

The same this is happening for Google maps. Is it expected that many requests will have no data? I can't seem to capture any tiles at level 17 or beyond, all requests fail. Why does it make invalid requests?

Re: Caching tiles...how does it work?

Please give me your area coordinates, zoom levels, provider and style. I'll check it out.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.