separate remove() job

This commit is contained in:
Thomas Rudin 2019-01-26 10:35:33 +01:00
parent 4f8983141e
commit 98780830f4

View File

@ -39,12 +39,40 @@ func renderMapblocks(ctx *app.App, jobs chan *coords.TileCoords, mblist []*mapbl
"Zoom": tc.Zoom,
"LayerId": tc.LayerId,
}
logrus.WithFields(fields).Debug("Dispatching tile rendering (z11-1)")
tilecount++
logrus.WithFields(fields).Debug("Tile removing (z12-1)")
//remove tile
ctx.Objectdb.RemoveTile(tc)
}
}
tileRenderedMap = make(map[string]bool)
for i := 12; i >= 1; i-- {
for _, mb := range mblist {
//13
tc := coords.GetTileCoordsFromMapBlock(mb.Pos, ctx.Config.Layers)
//12-1
tc = tc.ZoomOut(13 - i)
key := getTileKey(tc)
if tileRenderedMap[key] {
continue
}
tileRenderedMap[key] = true
fields := logrus.Fields{
"X": tc.X,
"Y": tc.Y,
"Zoom": tc.Zoom,
"LayerId": tc.LayerId,
}
logrus.WithFields(fields).Debug("Dispatching tile rendering (z12-1)")
tilecount++
//dispatch re-render
jobs <- tc