Quick fix to make vector tiles backend work again

This commit is contained in:
Komяpa 2010-07-13 00:21:55 +03:00
parent ba749d00b2
commit 518ff845e2
2 changed files with 7 additions and 4 deletions

View file

@ -48,10 +48,11 @@ class QuadTileBackend:
self.path = path # path to tile files
self.lang = lang # map language to use
self.tiles = {} # loaded vector tiles go here
self.data_projection = proj # which projection used to cut map in tiles
self.proj = proj # which projection used to cut map in tiles
self.keep_tiles = 190 # a number of tiles to cache in memory
self.tile_load_log = [] # used when selecting which tile to unload
def filename(self, (z,x,y)):
return "%s/z%s/%s/x%s/%s/y%s.vtile"%(self.path, z, x/1024, x, y/1024, y)
def load_tile(self, k):
@ -87,7 +88,7 @@ class QuadTileBackend:
zoom = int(zoom)
zoom = min(zoom, self.max_zoom) ## If requested zoom is better than the best, take the best
zoom = max(zoom, 0) ## Negative zooms are nonsense
a,d,c,b = [int(x) for x in projections.tile_by_bbox(bbox,zoom, self.data_projection)]
a,d,c,b = [int(x) for x in projections.tile_by_bbox(bbox,zoom, self.proj)]
resp = {}
for tile in set([(zoom,i,j) for i in range(a, c+1) for j in range(b, d+1)]):
try:

View file

@ -27,7 +27,9 @@ import Queue
from debug import debug, Timer
from vtiles_backend import QuadTileBackend as DataBackend
from backend.postgis import PostGisBackend as DataBackend
from backend.vtile import QuadTileBackend as DataBackend
#from style import Styling
from mapcss import MapCSS as Styling
from render import RasterTile
@ -78,7 +80,7 @@ class Navigator:
self.f = True
undef = None
self.style = Styling()
self.style.parse(open("styles/openstreetinfo.mapcss","r").read())
self.style.parse(open("styles/mapink.mapcss","r").read())
da = gtk.DrawingArea()
da.add_events(gtk.gdk.BUTTON1_MOTION_MASK)