From 99e55b0319adb45e9a524dbac832591041b6e286 Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Mon, 21 Jan 2019 11:21:56 +0100 Subject: [PATCH] only cached tile access from web --- web/tiles.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/tiles.go b/web/tiles.go index d5f3df8..b8ae030 100644 --- a/web/tiles.go +++ b/web/tiles.go @@ -27,7 +27,7 @@ func (t *Tiles) ServeHTTP(resp http.ResponseWriter, req *http.Request) { zoom, _ := strconv.Atoi(parts[3]) c := coords.NewTileCoords(x, y, zoom, layerid) - data, err := t.ctx.Tilerenderer.Render(c) + tile, err := t.ctx.Tiledb.GetTile(c) if err != nil { resp.WriteHeader(500) @@ -35,6 +35,13 @@ func (t *Tiles) ServeHTTP(resp http.ResponseWriter, req *http.Request) { } else { resp.Header().Add("content-type", "image/png") - resp.Write(data) + + if tile == nil { + //TODO: blank tile + + } else { + resp.Write(tile.Data) + + } } }