forked from MTSR/mapserver
28 lines
484 B
Go
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})
|
|
}
|