1
0
forked from MTSR/mapserver

fix initial rendering glitch

This commit is contained in:
NatureFreshMilk 2019-02-08 08:11:06 +01:00
parent 986b9dbdb9
commit 44b4eef640
4 changed files with 20 additions and 4 deletions

View File

@ -177,6 +177,15 @@ func (a *MapBlockAccessor) FindMapBlocksByPos(lastpos *coords.MapBlockCoords, li
result.LastPos = newlastpos
result.List = mblist
fields = logrus.Fields{
"len(List)": len(result.List),
"unfilteredCount": result.UnfilteredCount,
"hasMore": result.HasMore,
"limit": limit,
}
logrus.WithFields(fields).Debug("FindMapBlocksByPos:Result")
return &result, nil
}

View File

@ -46,6 +46,12 @@ func TestStrings(t *testing.T){
t.Fatal("getint failed")
}
s.SetInt("i3", -123)
i = s.GetInt("i3", 456)
if i != -123 {
t.Fatal("getint negative failed")
}
if s.GetInt("i2", 111) != 111 {
t.Fatal("getint with default failed")
}

View File

@ -10,7 +10,8 @@ import (
)
func getTileKey(tc *coords.TileCoords) string {
return strconv.Itoa(tc.X) + "/" + strconv.Itoa(tc.Y) + "/" + strconv.Itoa(tc.Zoom)
return strconv.Itoa(tc.X) + "/" + strconv.Itoa(tc.Y) + "/" +
strconv.Itoa(tc.Zoom) + "/" + strconv.Itoa(tc.LayerId)
}
func renderMapblocks(ctx *app.App, jobs chan *coords.TileCoords, mblist []*mapblockparser.MapBlock) int {

View File

@ -26,9 +26,9 @@ func initialRender(ctx *app.App, jobs chan *coords.TileCoords) {
}
logrus.WithFields(fields).Info("Starting initial rendering job")
lastx := ctx.Settings.GetInt(settings.SETTING_LASTX, -1)
lasty := ctx.Settings.GetInt(settings.SETTING_LASTY, -1)
lastz := ctx.Settings.GetInt(settings.SETTING_LASTZ, -1)
lastx := ctx.Settings.GetInt(settings.SETTING_LASTX, coords.MinCoord-1)
lasty := ctx.Settings.GetInt(settings.SETTING_LASTY, coords.MinCoord-1)
lastz := ctx.Settings.GetInt(settings.SETTING_LASTZ, coords.MinCoord-1)
lastcoords := coords.NewMapBlockCoords(lastx, lasty, lastz)