1
0
forked from MTSR/mapserver

only cached tile access from web

This commit is contained in:
NatureFreshMilk 2019-01-21 11:21:56 +01:00
parent 794498e41b
commit 99e55b0319

View File

@ -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)
}
}
}