map::slippy::cache(n)
π map::slippy::cache β ok bestie, let's talk tiles π
You're reading the n manual page for map::slippy::cache, straight outta the Mapping utilities corner of the world. Buckle up, it's giving filesystem realness π
β¨ NAME β¨
map::slippy::cache β management of a tile cache in the local filesystem ποΈβ¨
πΈ 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
π¦ DESCRIPTION π¦
Okay so, this package hands you a class for managing a cache of tiles for slippy-based maps, and it lives right there in the local filesystem. That's the whole thing. It's a tile cache manager. She manages. π
BEWARE, Attention!! Version 0.5 is NOT backward compatible with version 0.3 and earlier. Not even a little. This is because the internals of this package got switched over to using version 0.8 of map::slippy. So if you're running the old stuff, no cap, it will not vibe with this. π
π₯ API π₯
::map::slippy::cache cacheName cachedir providerβ creates the cachecacheNameand sets it up with two things: the path to the directory contaiing... ok literally the directory that holds the locally cached tiles (cachedir), and the command prefix it's gonna pull tiles from when someone asks for a tile the cache itself doesn't know about yet (provider).
The result of the command is cacheName. That's what you get back, bestie. β¨
π METHODS π
cacheName valid tile ?msgvar?β checks whether the given tile identifier is valid. It's just a little convenience wrapper around::map::slippy tile valid, same interface and everything. Zero drama. π«ΆcacheName exists tileβ tests whether the cache actually contains the specified tile or not. You get back a boolean: true if the tile is known, false otherwise. The tile is identified by a list with three elements β zoom level, row, and column number, in that exact order. Don't shuffle them, that's not the move. πcacheName get tile donecmdβ the main character method of the entire cache π₯ It retrieves the image for the specified tile from the cache. The tile identifier is a list of three elements: the zoom level, the row, and the 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 is forthcoming. It'll be called with either 2 or 3 arguments, like so:
- The string
set, the tile, and the image. - The string
unset, and the tile.
Those two possibilities are how it either signals the image for the tile, or signals that the tile has no image defined for it. Two paths, one callback. Slay. β¨
When the cache has no information about the tile at all, it'll invoke the provider command prefix you specified back during construction, adding three arguments: the string get, the tile, and a callback into the cache. That callback is what the provider invokes to either transfer the image into the cache, or signal that the tile has no image. π
And here's the cute part: when multiple requests for the same tile come in, only one request gets issued to the provider. Efficiency 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(n) page β so go forth, cache those tiles, and remember: only one request per tile, no cap. π§π
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms