1map::slippy::cache(n) Mapping utilities map::slippy::cache(n)
2
3
4
5______________________________________________________________________________
6
8 map::slippy::cache - Management of a tile cache in the local filesystem
9
11 package require Tcl 8.4
12
13 package require Tk 8.4
14
15 package require img::png
16
17 package require map::slippy
18
19 package require map::slippy::cache ?0.2?
20
21 ::map::slippy::cache cacheName cachedir provider
22
23 cacheName valid tile ?msgvar?
24
25 cacheName exists tile
26
27 cacheName get tile donecmd
28
29______________________________________________________________________________
30
32 This package provides a class for managing a cache of tiles for slippy-
33 based maps in the local filesystem.
34
36 ::map::slippy::cache cacheName cachedir provider
37 Creates the cache cacheName and configures it with both the path
38 to the directory contaiing the locally cached tiles (cachedir),
39 and the command prefix from which it will pull tiles asked for
40 and not yet known to the cache itself (provider).
41
42 The result of the command is cacheName.
43
44 METHODS
45 cacheName valid tile ?msgvar?
46 This method checks the validity of a the given tile identifier.
47 This is a convenience wrapper to ::map::slippy tile valid and
48 has the same interface.
49
50 cacheName exists tile
51 This methods tests whether the cache contains the specified tile
52 or not. The result is a boolean value, true if the tile is
53 known, and false otherwise. The tile is identified by a list
54 containing three elements, zoom level, row, and column number,
55 in this order.
56
57 cacheName get tile donecmd
58 This is the main method of the cache, retrieving the image for
59 the specified tile from the cache. The tile identifier is a list
60 containing three elements, the zoom level, row, and column num‐
61 ber of the tile, in this order.
62
63 The command refix donecmd will be invoked when the cache either
64 knows the image for the tile or that no image will forthcoming.
65 It will be invoked with either 2 or 3 arguments, i.e.
66
67 [1] The string set, the tile, and the image.
68
69 [2] The string unset, and the tile.
70
71 These two possibilities are used to either signal the image for
72 the tile, or that the tile has no image defined for it.
73
74 When the cache has no information about the tile it will invoke
75 the provider command prefix specified during its construction,
76 adding three arguments: The string get, the tile, and a callback
77 into the cache. The latter will be invoked by the provider to
78 either transfer the image to the cache, or signal that the tile
79 has no image.
80
81 When multiple requests for the same tile are made only one re‐
82 quest will be issued to the provider.
83
85 [1] http://wiki.openstreetmap.org/wiki/Main_Page
86
88 cache, filesystem, location, map, slippy, tile, zoom
89
90
91
92tcllib 0.2 map::slippy::cache(n)