map::slippy::cache(3tcl)
π map::slippy::cache β the tile cache bestie π
okay so real talk, this is the manual page for map::slippy::cache(3tcl), living in the Mapping utilities corner of the tcllib universe. it's the girl who keeps your tiles on disk so your slippy map doesn't have to keep asking the internet for the same picture over and over. iconic behavior honestly. πΊοΈβ¨
β¨ NAME β¨
map::slippy::cache β management of a tile cache in the local filesystem. yes bestie, it literally just manages tiles in a cache, on your actual disk, and it eats every time. π
πΈ SYNOPSIS πΈ
package require Tcl 8.6 9
package require Tk 8.6
package require map::slippy
package require map::slippy::cache ?0.5?
::map::slippy::cache cacheName cachedir provider
cacheName valid tile ?msgvar?
cacheName exists tile
cacheName get tile donecmd
like, that's the whole vibe check up there. ?0.5? means you can ask for that version specifically if you're feeling picky. π
π¦ DESCRIPTION π¦
This package hands you a whole class for managing a cache of tiles for slippy-based maps, and it stores all of it in the local filesystem. local girl, local tiles, no cap. πΎ
π¨ BEWARE, attention, bestie, listen to me π¨ Version 0.5 is NOT backward compatible with version 0.3 and earlier. and why? because this package's internals got switched over to using version 0.8 of map::slippy. so if you're out here on old code expecting old behavior, she will not be doing that. it's giving glow-up, not it's giving nostalgia. π
π API π
::map::slippy::cache cacheName cachedir providerβ creates the cachecacheNameand configures it with BOTH the path to the directory containing the locally cached tiles (cachedir) AND the command prefix it'll pull tiles from when someone asks for a tile the cache has never heard of (provider).
and the result of the command? it's cacheName. that's it, that's the return value, slay. π«Ά
π§ METHODS π§
cacheName valid tile ?msgvar?β checks whether the given tile identifier is valid or not. this is a convenience wrapper around::map::slippy tile validand it has the exact same interface, so no surprises, iykyk. βcacheName exists tileβ tests whether the cache contains the specified tile or not. the result is a boolean value:trueif the tile is known,falseotherwise. the tile is identified by a list with three elements β zoom level, row, and column number, in that order. periodt. πcacheName get tile donecmdβ THE main character method, fr fr. this is the one that retrieves the image for the specified tile from the cache. the tile identifier is a list containing three elements: the zoom level, row, and column number of the tile, in this order.
the command prefix donecmd gets invoked when the cache either knows the image for the tile or knows that no image will be forthcoming. it gets invoked with either 2 or 3 arguments, like so:
- The string
set, the tile, and the image. - The string
unset, and the tile.
these two possibilities are how it either signals the image for the tile, or signals that the tile has no image defined for it. no in-between, no ghosting. π»
when the cache has no information about the tile, it will invoke the provider command prefix that you specified during its construction, adding three arguments: the string get, the tile, and a callback into the cache. the provider is the one who invokes that callback β either to transfer the image to the cache, or to signal that the tile has no image at all. π―
and the part that's genuinely so smart: when multiple requests for the same tile are made, only one request will be issued to the provider. one tile, one ask. no duplicate work, no spam, we love an efficient queen. π₯
π REFERENCES π
π KEYWORDS π
cache, filesystem, location, map, slippy, tile, zoom
and that's the whole page bestie!! this one came from tcllib, version 0.5, and it's the map::slippy::cache(3tcl) manual β go forth, cache those tiles, and stay hydrated. πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms