diff --git a/app/app.go b/app/app.go index b9cb3aa..ace9738 100644 --- a/app/app.go +++ b/app/app.go @@ -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 diff --git a/app/setup.go b/app/setup.go index 89e200d..e2b4299 100644 --- a/app/setup.go +++ b/app/setup.go @@ -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] != "" { diff --git a/mapobject/setup.go b/mapobject/setup.go index dc98f99..375418f 100644 --- a/mapobject/setup.go +++ b/mapobject/setup.go @@ -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) } diff --git a/tilerendererjob/incremental.go b/tilerendererjob/incremental.go index 2c4323f..0b2c41d 100644 --- a/tilerendererjob/incremental.go +++ b/tilerendererjob/incremental.go @@ -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) diff --git a/tilerendererjob/initial.go b/tilerendererjob/initial.go index bc77cac..47546af 100644 --- a/tilerendererjob/initial.go +++ b/tilerendererjob/initial.go @@ -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) diff --git a/web/mapblock.go b/web/mapblock.go index 7ccac5c..152a29a 100644 --- a/web/mapblock.go +++ b/web/mapblock.go @@ -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)