1
0
forked from MTSR/mapserver
mapserver/server/mapobject/setup.go
2019-01-23 16:06:56 +01:00

28 lines
484 B
Go

package mapobject
import (
"mapserver/app"
"mapserver/mapblockparser"
)
type Listener struct {
ctx *app.App
}
func (this *Listener) OnParsedMapBlock(block *mapblockparser.MapBlock) {
err := this.ctx.Objectdb.RemoveMapData(block.Pos)
if err != nil {
panic(err)
}
for id, name := range block.BlockMapping {
if name == "mapserver:poi" {
onPoiBlock(id, block, this.ctx.Objectdb)
}
}
}
func Setup(ctx *app.App) {
ctx.BlockAccessor.AddListener(&Listener{ctx: ctx})
}