map::slippy::cache(n) | Mapping utilities | map::slippy::cache(n) |
map::slippy::cache - Management of a tile cache in the local filesystem
package require Tcl 8.4
package require Tk 8.4
package require img::png
package require map::slippy
package require map::slippy::cache ?0.2?
::map::slippy::cache cacheName cachedir provider
cacheName valid tile ?msgvar?
cacheName exists tile
cacheName get tile donecmd
This package provides a class for managing a cache of tiles for slippy-based maps in the local filesystem.
The result of the command is cacheName.
The command refix donecmd will be invoked when the cache either knows the image for the tile or that no image will forthcoming. It will be invoked with either 2 or 3 arguments, i.e.
These two possibilities are used to either signal the image for the tile, or that the tile has no image defined for it.
When the cache has no information about the tile it will invoke the provider command prefix specified during its construction, adding three arguments: The string get, the tile, and a callback into the cache. The latter will be invoked by the provider to either transfer the image to the cache, or signal that the tile has no image.
When multiple requests for the same tile are made only one request will be issued to the provider.
cache, filesystem, location, map, slippy, tile, zoom
0.2 | map |