diff --git a/server/app/config.go b/server/app/config.go index 6bb2a03..08e515a 100644 --- a/server/app/config.go +++ b/server/app/config.go @@ -31,6 +31,11 @@ type MapObjectConfig struct { Digilines bool `json:"digilines"` Travelnet bool `json:"travelnet"` Mapserver bool `json:"mapserver"` + Mission bool `json:"mission"` + Jumpdrive bool `json:"jumpdrive"` + Smartshop bool `json:"smartshop"` + Fancyvend bool `json:"fancyvend"` + ATM bool `json:"atm"` } type WebApiConfig struct { @@ -94,6 +99,11 @@ func ParseConfig(filename string) (*Config, error) { Digilines: true, Travelnet: true, Mapserver: true, + Mission: true, + Jumpdrive: true, + Smartshop: true, + Fancyvend: true, + ATM: true, } cfg := Config{ diff --git a/server/mapobject/setup.go b/server/mapobject/setup.go index 8adf721..97088d3 100644 --- a/server/mapobject/setup.go +++ b/server/mapobject/setup.go @@ -188,15 +188,27 @@ func Setup(ctx *app.App) { } //missions - l.AddMapObject("missions:mission", &MissionBlock{}) + if ctx.Config.MapObjects.Mission { + l.AddMapObject("missions:mission", &MissionBlock{}) + } //jumpdrive, TODO: fleet controller - l.AddMapObject("jumpdrive:engine", &JumpdriveBlock{}) + if ctx.Config.MapObjects.Jumpdrive { + l.AddMapObject("jumpdrive:engine", &JumpdriveBlock{}) + } //smartshop - l.AddMapMultiObject("smartshop:shop", &SmartShopBlock{}) + if ctx.Config.MapObjects.Smartshop { + l.AddMapMultiObject("smartshop:shop", &SmartShopBlock{}) + } - //TODO: atm, shops (smart, fancy) + if ctx.Config.MapObjects.Fancyvend { + //TODO + } + + if ctx.Config.MapObjects.ATM { + //TODO + } ctx.BlockAccessor.Eventbus.AddListener(&l) } diff --git a/server/static/js/main.js b/server/static/js/main.js index 0fd4df0..fca6168 100644 --- a/server/static/js/main.js +++ b/server/static/js/main.js @@ -33,6 +33,10 @@ api.getConfig().then(function(cfg){ overlays["Player"] = new PlayerOverlay(wsChannel, layerMgr); overlays["POI"] = new PoiOverlay(wsChannel, layerMgr); overlays["Labels"] = new LabelOverlay(wsChannel, layerMgr); + + map.addLayer(overlays["Player"]); + map.addLayer(overlays["POI"]); + map.addLayer(overlays["Labels"]); } if (cfg.mapobjects.travelnet) { @@ -65,12 +69,9 @@ api.getConfig().then(function(cfg){ overlays["Protector"] = new ProtectorOverlay(wsChannel, layerMgr); } - overlays["Missions"] = new MissionOverlay(wsChannel, layerMgr); - - //Default enabled overlays - map.addLayer(overlays["Player"]); - map.addLayer(overlays["POI"]); - map.addLayer(overlays["Labels"]); + if (cfg.mapobjects.mission) { + overlays["Missions"] = new MissionOverlay(wsChannel, layerMgr); + } L.control.layers(layers, overlays).addTo(map);