Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Sandwich as a provider supported by name alone

  • Loading branch information...
commit 818ecad1e0b081d48e25485e7c1e417d4dffcc2c 1 parent 36c6daa
@migurski migurski authored
View
3  TileStache/Config.py
@@ -472,6 +472,9 @@ def _parseConfigfileLayer(layer_dict, config, dirpath):
if 'layer id key' in provider_dict:
provider_kwargs['layer_id_key'] = provider_dict['layer id key']
+ elif _class is Providers.Sandwich.Provider:
+ provider_kwargs['stack'] = provider_dict['stack']
+
elif 'class' in provider_dict:
_class = loadClassPath(provider_dict['class'])
provider_kwargs = provider_dict.get('kwargs', {})
View
4 TileStache/Providers.py
@@ -90,6 +90,7 @@
import Vector
import MBTiles
import Geography
+import Sandwich
from .Mapnik import ImageProvider as MapnikImage, GridProvider as MapnikGrid
# Already deprecated; provided for temporary backward-compatibility with
@@ -119,6 +120,9 @@ def getProviderByName(name):
elif name.lower() == 'mapnik grid':
return MapnikGrid
+ elif name.lower() == 'sandwich':
+ return Sandwich.Provider
+
raise Exception('Unknown provider name: "%s"' % name)
class Proxy:
View
5 TileStache/Sandwich.py
@@ -2,7 +2,6 @@
from StringIO import StringIO
from . import Core
-from . import getTile
import Image
import Blit
@@ -104,6 +103,8 @@ def draw_stack(stack, coord, config, tiles):
def layer_bitmap(layer, coord):
"""
"""
+ from . import getTile
+
mime, body = getTile(layer, coord, 'png')
image = Image.open(StringIO(body)).convert('RGBA')
@@ -147,7 +148,7 @@ def make_color(color):
raise Core.KnownUnknown('Color must start with hash: "%s"' % color)
if len(color) not in (4, 5, 7, 9):
- raise Core.KnownUnknown('Color must have three, four, six or seven hex chars: "%s"' % color)
+ raise Core.KnownUnknown('Color must have three, four, six or eight hex chars: "%s"' % color)
if len(color) == 4:
color = ''.join([color[i] for i in (0, 1, 1, 2, 2, 3, 3)])
Please sign in to comment.
Something went wrong with that request. Please try again.