按照此处的示例,我正在尝试使用tilestache创建一个用于显示的图层。有没有办法获得引用网址?
我似乎找不到任何关于该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))
...