Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added configurable "tile height" setting for layers

  • Loading branch information...
commit 9e502bbcd616dead59fa7fc41bf1ba6c9d6404dc 1 parent e5208cd
Michal Migurski authored
Showing with 17 additions and 0 deletions.
  1. +9 −0 API.html
  2. +3 −0  TileStache/Config.py
  3. +5 −0 TileStache/Core.py
View
9 API.html
@@ -704,6 +704,7 @@
"allowed origin": …,
"maximum cache age": …,
"redirects": …,
+ "tile height": …,
"jpeg options": …,
"png options": …
}
@@ -818,6 +819,14 @@
to force all requests for JPEG tiles to be redirected to PNG tiles.
</dd>
+ <dt>tile height</dt>
+ <dd>
+ An optional integer gives the height of the image tile in pixels. You
+ almost always want to leave this at the default value of <samp>256</samp>,
+ but you can use a value of <samp>512</samp> to create double-size,
+ double-resolution tiles for high-density phone screens.
+ </dd>
+
<dt>jpeg options</dt>
<dd>
An optional dictionary of JPEG creation options, passed through
View
3  TileStache/Config.py
@@ -361,6 +361,9 @@ def _parseConfigfileLayer(layer_dict, config, dirpath):
if 'redirects' in layer_dict:
layer_kwargs['redirects'] = dict(layer_dict['redirects'])
+ if 'tile height' in layer_dict:
+ layer_kwargs['tile_height'] = int(layer_dict['tile height'])
+
if 'preview' in layer_dict:
preview_dict = layer_dict['preview']
View
5 TileStache/Core.py
@@ -23,6 +23,8 @@
"bounds": { ... },
"allowed origin": ...,
"maximum cache age": ...,
+ "redirects": ...,
+ "tile height": ...,
"jpeg options": ...,
"png options": ...
}
@@ -64,6 +66,9 @@
If a request is made for a tile with an extension in the dictionary keys,
a response can be generated that redirects the client to the same tile
with another extension.
+- "tile height" gives the height of the image tile in pixels. You almost always
+ want to leave this at the default value of 256, but you can use a value of 512
+ to create double-size, double-resolution tiles for high-density phone screens.
- "jpeg options" is an optional dictionary of JPEG creation options, passed
through to PIL: http://www.pythonware.com/library/pil/handbook/format-jpeg.htm.
- "png options" is an optional dictionary of PNG creation options, passed
Please sign in to comment.
Something went wrong with that request. Please try again.