forked from MTSR/mapserver
add colored travelnets to mapobjectdb
This commit is contained in:
parent
6e53fad9f3
commit
35860af706
@ -42,6 +42,20 @@ func Setup(ctx *app.App) {
|
||||
//travelnet
|
||||
if ctx.Config.MapObjects.Travelnet {
|
||||
l.AddMapObject("travelnet:travelnet", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_red", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_orange", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_blue", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_cyan", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_green", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_dark_green", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_violet", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_pink", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_magenta", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_brown", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_grey", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_dark_grey", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_black", &TravelnetBlock{})
|
||||
l.AddMapObject("travelnet:travelnet_white", &TravelnetBlock{})
|
||||
}
|
||||
|
||||
//protector
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
type TravelnetBlock struct{}
|
||||
|
||||
func (this *TravelnetBlock) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *mapobjectdb.MapObject {
|
||||
func (tn *TravelnetBlock) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *mapobjectdb.MapObject {
|
||||
md := block.Metadata.GetMetadata(x, y, z)
|
||||
|
||||
// ignore (P) prefixed stations
|
||||
@ -21,6 +21,7 @@ func (this *TravelnetBlock) onMapObject(x, y, z int, block *mapblockparser.MapBl
|
||||
o.Attributes["owner"] = md["owner"]
|
||||
o.Attributes["station_name"] = md["station_name"]
|
||||
o.Attributes["station_network"] = md["station_network"]
|
||||
o.Attributes["nodename"] = block.GetNodeName(x, y, z)
|
||||
|
||||
return o
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user