マップ タイルを OpenLayers Web マップに提供する必要がある Pyramid アプリケーションを構築しています。
TileStache は、必要なタイルを提供する WMS タイル サーバーであり、Pyramid アプリのビューとしてアクセスしたいと考えています。
単独で、TileStache の URL にアクセスすると、うまくwww.exampletilestacheurl.com/LAYERNAME/0/0/0.png
機能します。タイルが適切に返されます。
Pyramid では、TileStache アプリをビューとしてラップしたいと考えていますpyramid.wsgi.wsgiapp
。私の目標は、訪問www.mypyramidapp.com/tilestache/LAYERNAME/0/0/0.png
が上記の TileStache url の例と同じように機能することです。
TileStache アプリをラップしてビューにします。
from pyramid.wsgi import wsgiapp
@wsgiapp
def tileserver(environ, start_response):
# Enable TileStache tile server
import TileStache
tile_app = TileStache.WSGITileServer('tilestache/tilestache.cfg', autoreload=False)
return [tile_app]
のビューにルートを割り当てますmyapp.__init__.main
:
from tilestache import tileserver
config.add_view(tileserver, name='tilestache')
config.add_route('tilestache', '/tilestache')
しかし、で始まる任意の URL にアクセスすると、 「wsgiapp の仕組みに精通している人はいますか?」がwww.mypyramidapp.com/tilestache/
返されます。IndexError: list index out of range.