Finished logic to supress pyramid regeneration in mtwebmapper. Untested.

This commit is contained in:
Sascha L. Teichmann
2016-05-08 15:38:50 +02:00
parent 4bed73d9e3
commit 0900bd16ce
3 changed files with 30 additions and 15 deletions

View File

@ -177,6 +177,8 @@ func activeChanges(changes []xzc) map[xz]bool {
func (tu *tileUpdater) doUpdates() {
bth := common.NewBaseTileHash()
for {
tu.cond.L.Lock()
for len(tu.changes) == 0 {
@ -201,7 +203,7 @@ func (tu *tileUpdater) doUpdates() {
btc := common.NewBaseTileCreator(
client, tu.colors, tu.bg,
tu.yMin, tu.yMax,
tu.transparent, baseDir, true)
tu.transparent, baseDir, bth.Update)
done.Add(1)
go tu.updateBaseTiles(jobs, btc, &done)
}
@ -334,8 +336,12 @@ func (tu *tileUpdater) updateBaseTiles(
for job := range jobs {
xz := job.dequantize()
//log.Printf("%d/%d %d/%d", x, z, job.X, job.Z)
if err := btc.CreateTile(xz.X-1, xz.Z-1, int(job.X), int(job.Z)); err != nil {
updated, err := btc.CreateTile(xz.X-1, xz.Z-1, int(job.X), int(job.Z))
if err != nil {
log.Printf("WARN: create tile failed: %s\n", err)
}
if !updated {
job.canceled = true
}
}
}