1
0
forked from MTSR/mapserver
This commit is contained in:
NatureFreshMilk 2019-01-24 13:55:29 +01:00
parent ccd5c4096b
commit f132363342
3 changed files with 21 additions and 13 deletions

View File

@ -55,6 +55,10 @@ func NewMetadata() *Metadata {
return &md return &md
} }
func (md *Metadata) GetMetadata(x, y, z int) map[string]string {
return md.GetPairsMap(getNodePos(x, y, z))
}
func (md *Metadata) GetPairsMap(pos int) map[string]string { func (md *Metadata) GetPairsMap(pos int) map[string]string {
pairsMap := md.Pairs[pos] pairsMap := md.Pairs[pos]
if pairsMap == nil { if pairsMap == nil {

View File

@ -12,14 +12,18 @@ func onPoiBlock(id int, block *mapblockparser.MapBlock, odb mapobjectdb.DBAccess
for z := 0; z < 16; z++ { for z := 0; z < 16; z++ {
name := block.GetNodeName(x, y, z) name := block.GetNodeName(x, y, z)
if name == "mapserver:poi" { if name == "mapserver:poi" {
md := block.Metadata.GetMetadata(x, y, z)
o := mapobjectdb.NewMapObject(&block.Pos, x, y, z, "poi") o := mapobjectdb.NewMapObject(&block.Pos, x, y, z, "poi")
o.Attributes["name"] = "test" o.Attributes["name"] = md["name"]
o.Attributes["category"] = md["category"]
o.Attributes["url"] = md["url"]
o.Attributes["active"] = md["active"]
o.Attributes["owner"] = md["owner"]
odb.AddMapData(o) odb.AddMapData(o)
} }
} }
} }
} }
panic("OK") //XXX
} }