| |
- cgiHandler(environ, config='./tilestache.cfg', debug=False)
- Read environment PATH_INFO, load up configuration, talk to stdout by CGI.
- handleRequest(layer, coord, extension)
- Get a type string and tile binary for a given request layer tile.
Arguments:
- layer: instance of Core.Layer to render.
- coord: one ModestMaps.Core.Coordinate corresponding to a single tile.
- extension: filename extension to choose response type, e.g. "png" or "jpg".
This is the main entry point, after site configuration has been loaded
and individual tiles need to be rendered.
- modpythonHandler(request)
- Handle a mod_python request.
Example Apache configuration for TileStache:
<Directory /home/migurski/public_html/TileStache>
AddHandler mod_python .py
PythonHandler TileStache::modpythonHandler
PythonOption config /etc/tilestache.cfg
</Directory>
Configuration options, using PythonOption directive:
- config: path to configuration file, defaults to "tilestache.cfg",
using request.filename as the current working directory.
- parseConfigfile(configpath)
- Parse a configuration file and return a Configuration object.
Configuration file is formatted as JSON with two sections, "cache" and "layers":
{
"cache": { ... },
"layers": {
"layer-1": { ... },
"layer-2": { ... },
...
}
}
The full path to the file is significant, used to
resolve any relative paths found in the configuration.
See the Caches module for more information on the "caches" section,
and the Core and Providers modules for more information on the
"layers" section.
|