1

ここの例に従って、タイルスタッシュを使用して表示用のレイヤーを作成しようとしています。参照URLを取得する方法はありますか?

layerオブジェクトが何であるかについてのドキュメントが見つからないようです。このオブジェクトには、使用できる何かがあるのではないかと思います...

class BaselineLayerProvider(object):
    def __init__(self, layer, *args, **kwargs):
        self.layer = layer
        self.provider = ModestMaps.OpenStreetMap.Provider()                

    def renderArea(self, width, height, srs, xmin, ymin, xmax, ymax, zoom):
        print self.layer
        print dir(self.layer)

        # first, figure out the bounding box of the tile we're rendering
        nw = self.layer.projection.projLocation(ModestMaps.Core.Point(xmin, ymin))
        se = self.layer.projection.projLocation(ModestMaps.Core.Point(xmax, ymax))
        max_lat = max(nw.lat, se.lat)
        min_lat = min(nw.lat, se.lat)
        max_lon = max(nw.lon, se.lon)
        min_lon = min(nw.lon, se.lon)

        bbox = Polygon.from_bbox((min_lon, min_lat, max_lon, max_lat))
        ...
4

1 に答える 1

1

Layer オブジェクトについては、http: //tilestache.org/doc/#layersで説明しています。

HTTP リファラーを取得する方法は提供していません。この機能を追加する必要がある場合は、独自の代替 WSGI サーバーを作成して使用できます。Tilestache ソースには、次の例のようないくつかの例があります。

https://github.com/migurski/TileStache/blob/master/TileStache/Goodies/ExternalConfigServer.py

于 2012-08-03T17:50:26.530 に答える