BlockAccessor -> MapBlockAccessor
This commit is contained in:
parent
2f2e1d0d58
commit
2b02558ba0
@ -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
|
||||
|
@ -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] != "" {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user