cache

cache is used internally within layer to manage storage of tiles. It is rarely necessary to use cache directly.

mapsense.cache(l[, u])
Constructs a new cache with the specified load function l and unload function u. See mapsense.layer for more information on the load and unload functions.
cache.peek(c)
Access the tile with coordinate c. Returns undefined if the specified tile is not present in the cache.
cache.load(c, p)
Invoke the cache's load function on the tile with coordinate c and the projection p.
cache.unload(k)
Invoke the cache's unload function on the tile whose key is k.
cache.locks()

Returns the cache storage object. The keys of this object are the tiles stored in the cache converted to a string with the format {Z}/{X}/{Y}.

cache.size([x])

Sets or gets the cache size. If the argument x is specified, the method sets the cache's size. If no arguments are specified, the method returns the cache's size.