TileStache.Goodies.Providers.MapnikGrid | index |
Mapnik UTFGrid Provider.
Takes the first layer from the given mapnik xml file and renders it as UTFGrid
https://github.com/mapbox/utfgrid-spec/blob/master/1.2/utfgrid.md
It can then be used for this:
http://mapbox.github.com/wax/interaction-leaf.html
Only works with mapnik>=2.0 (Where the Grid functionality was introduced)
Use Sperical Mercator projection and the extension "json"
Sample configuration:
"provider":
{
"class": "TileStache.Goodies.Providers.MapnikGrid:Provider",
"kwargs":
{
"mapfile": "mymap.xml",
"fields":["name", "address"],
"layer_index": 0,
"wrapper": "grid",
"scale": 4
}
}
mapfile: the mapnik xml file to load the map from
fields: The fields that should be added to the resulting grid json.
layer_index: The index of the layer you want from your map xml to be rendered
wrapper: If not included the json will be output raw, if included the json will be wrapped in "wrapper(JSON)" (for use with wax)
scale: What to divide the tile pixel size by to get the resulting grid size. Usually this is 4.
buffer: buffer around the queried features, in px, default 0. Use this to prevent problems on tile boundaries.
Modules | ||||||
|
Classes | ||||||||||||||||
|
Functions | ||
|