1map::slippy::cache(n)          Mapping utilities         map::slippy::cache(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       map::slippy::cache - Management of a tile cache in the local filesystem
9

SYNOPSIS

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

DESCRIPTION

32       This package provides a class for managing a cache of tiles for slippy-
33       based maps in the local filesystem.
34

API

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       These two possibilities are used to either signal  the  image  for  the
71       tile, or that the tile has no image defined for it.
72
73       When  the  cache  has  no information about the tile it will invoke the
74       provider command prefix specified during its construction, adding three
75       arguments: The string get, the tile, and a callback into the cache. The
76       latter will be invoked by the provider to either transfer the image  to
77       the cache, or signal that the tile has no image.
78
79       When multiple requests for the same tile are made only one request will
80       be issued to the provider.
81

REFERENCES

83       [1]    http://wiki.openstreetmap.org/wiki/Main_Page
84

KEYWORDS

86       cache, filesystem, location, map, slippy, tile, zoom
87
88
89
90map                                   0.2                map::slippy::cache(n)
Impressum