BlockAccessor -> MapBlockAccessor

This commit is contained in:
NatureFreshMilk 2019-07-31 13:41:35 +02:00
parent 2f2e1d0d58
commit 2b02558ba0
6 changed files with 9 additions and 7 deletions

View File

@ -1,6 +1,7 @@
package app
import (
"mapserver/blockaccessor"
"mapserver/colormapping"
"mapserver/db"
"mapserver/eventbus"
@ -23,7 +24,8 @@ type App struct {
TileDB *tiledb.TileDB
Settings settings.Settings
BlockAccessor *mapblockaccessor.MapBlockAccessor
MapBlockAccessor *mapblockaccessor.MapBlockAccessor
BlockAccessor *blockaccessor.BlockAccessor
Colormapping *colormapping.ColorMapping
Mapblockrenderer *mapblockrenderer.MapBlockRenderer
Tilerenderer *tilerenderer.TileRenderer

View File

@ -71,7 +71,7 @@ func Setup(p params.ParamsType, cfg *Config) *App {
panic(err)
}
a.BlockAccessor = mapblockaccessor.NewMapBlockAccessor(
a.MapBlockAccessor = mapblockaccessor.NewMapBlockAccessor(
a.Blockdb,
expireDuration, purgeDuration,
cfg.MapBlockAccessorCfg.MaxItems)
@ -114,7 +114,7 @@ func Setup(p params.ParamsType, cfg *Config) *App {
}
//mapblock renderer
a.Mapblockrenderer = mapblockrenderer.NewMapBlockRenderer(a.BlockAccessor, a.Colormapping)
a.Mapblockrenderer = mapblockrenderer.NewMapBlockRenderer(a.MapBlockAccessor, a.Colormapping)
//mapserver database
if a.Worldconfig[worldconfig.CONFIG_PSQL_MAPSERVER] != "" {

View File

@ -162,5 +162,5 @@ func Setup(ctx *app.App) {
l.AddMapObject("locator:beacon_3", loc)
}
ctx.BlockAccessor.Eventbus.AddListener(&l)
ctx.MapBlockAccessor.Eventbus.AddListener(&l)
}

View File

@ -24,7 +24,7 @@ func incrementalRender(ctx *app.App) {
for true {
start := time.Now()
result, err := ctx.BlockAccessor.FindMapBlocksByMtime(lastMtime, ctx.Config.RenderingFetchLimit, ctx.Config.Layers)
result, err := ctx.MapBlockAccessor.FindMapBlocksByMtime(lastMtime, ctx.Config.RenderingFetchLimit, ctx.Config.Layers)
if err != nil {
panic(err)

View File

@ -18,7 +18,7 @@ func initialRender(ctx *app.App) {
for true {
start := time.Now()
result, err := ctx.BlockAccessor.FindNextLegacyBlocks(ctx.Settings, ctx.Config.Layers, ctx.Config.RenderingFetchLimit)
result, err := ctx.MapBlockAccessor.FindNextLegacyBlocks(ctx.Settings, ctx.Config.Layers, ctx.Config.RenderingFetchLimit)
if err != nil {
panic(err)

View File

@ -27,7 +27,7 @@ func (h *MapblockHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
z, _ := strconv.Atoi(parts[2])
c := coords.NewMapBlockCoords(x, y, z)
mb, err := h.ctx.BlockAccessor.GetMapBlock(c)
mb, err := h.ctx.MapBlockAccessor.GetMapBlock(c)
if err != nil {
resp.WriteHeader(500)