logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Api

::map::slippy::cachecacheNamecachedirprovider
              Creates  the  cache  cacheName and configures it with both the path to the directory contaiing the
              locally cached tiles (cachedir), and the command prefix from which it will pull  tiles  asked  for
              and not yet known to the cache itself (provider).

              The result of the command is cacheName.

   METHODScacheNamevalidtile ?msgvar?
              This  method checks the validity of a the given tile identifier.  This is a convenience wrapper to
              ::map::slippytilevalid and has the same interface.

       cacheNameexiststile
              This methods tests whether the cache contains the specified tile or not. The result is  a  boolean
              value, true if the tile is known, and false otherwise. The tile is identified by a list containing
              three elements, zoom level, row, and column number, in this order.

       cacheNamegettiledonecmd
              This  is the main method of the cache, retrieving the image for the specified tile from the cache.
              The tile identifier is a list containing three elements, the zoom level, row, and column number of
              the tile, in this order.

              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.

              [1]    The string set, the tile, and the image.

              [2]    The string unset, and the tile.

              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.

Description

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

       BEWARE, Attention Version 0.5 is NOTbackwardcompatible with version 0.3 and earlier.  This  is  due  to
       switching this package's internals to the use of version 0.8 of map::slippy.

Keywords

       cache, filesystem, location, map, slippy, tile, zoom

tcllib                                                 0.5                              map::slippy::cache(3tcl)

Name

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

References

Synopsis

       package require Tcl8.69

       package require Tk8.6

       package require map::slippy

       package require map::slippy::cache?0.5?::map::slippy::cachecacheNamecachedirprovidercacheNamevalidtile ?msgvar?

       cacheNameexiststilecacheNamegettiledonecmd

________________________________________________________________________________________________________________

See Also