1
0
forked from MTSR/mapserver

fix default overlay setup

This commit is contained in:
Thomas Rudin 2019-04-04 17:53:21 +02:00
parent a624b6795f
commit 75f2a7f2fe

View File

@ -5,126 +5,126 @@ function Overlaysetup(cfg, map, overlays, wsChannel, layerMgr){
if (cfg.mapobjects.mapserver_player) { if (cfg.mapobjects.mapserver_player) {
overlays.Player = new PlayerOverlay(wsChannel, layerMgr); overlays.Player = new PlayerOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("mapserver_player")) { if (cfg.defaultoverlays.indexOf("mapserver_player") >= 0) {
map.addLayer(overlays.Player); map.addLayer(overlays.Player);
} }
} }
if (cfg.mapobjects.mapserver_poi) { if (cfg.mapobjects.mapserver_poi) {
overlays.POI = new PoiOverlay(wsChannel, layerMgr); overlays.POI = new PoiOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("mapserver_poi")) { if (cfg.defaultoverlays.indexOf("mapserver_poi") >= 0) {
map.addLayer(overlays.POI); map.addLayer(overlays.POI);
} }
} }
if (cfg.mapobjects.mapserver_label) { if (cfg.mapobjects.mapserver_label) {
overlays.Label = new LabelOverlay(wsChannel, layerMgr); overlays.Label = new LabelOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("mapserver_label")) { if (cfg.defaultoverlays.indexOf("mapserver_label") >= 0) {
map.addLayer(overlays.Label); map.addLayer(overlays.Label);
} }
} }
if (cfg.mapobjects.mapserver_trainline) { if (cfg.mapobjects.mapserver_trainline) {
overlays.Trainlines = new TrainlineOverlay(wsChannel, layerMgr); overlays.Trainlines = new TrainlineOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("mapserver_trainline")) { if (cfg.defaultoverlays.indexOf("mapserver_trainline") >= 0) {
map.addLayer(overlays.Trainlines); map.addLayer(overlays.Trainlines);
} }
} }
if (cfg.mapobjects.mapserver_border) { if (cfg.mapobjects.mapserver_border) {
overlays.Border = new BorderOverlay(wsChannel, layerMgr); overlays.Border = new BorderOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("mapserver_border")) { if (cfg.defaultoverlays.indexOf("mapserver_border") >= 0) {
map.addLayer(overlays.Border); map.addLayer(overlays.Border);
} }
} }
if (cfg.mapobjects.travelnet) { if (cfg.mapobjects.travelnet) {
overlays.Travelnet = new TravelnetOverlay(wsChannel, layerMgr); overlays.Travelnet = new TravelnetOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("travelnet")) { if (cfg.defaultoverlays.indexOf("travelnet") >= 0) {
map.addLayer(overlays.Travelnet); map.addLayer(overlays.Travelnet);
} }
} }
if (cfg.mapobjects.bones) { if (cfg.mapobjects.bones) {
overlays.Bones = new BonesOverlay(wsChannel, layerMgr); overlays.Bones = new BonesOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("bones")) { if (cfg.defaultoverlays.indexOf("bones") >= 0) {
map.addLayer(overlays.Bones); map.addLayer(overlays.Bones);
} }
} }
if (cfg.mapobjects.digilines) { if (cfg.mapobjects.digilines) {
overlays["Digilines LCD"] = new LcdOverlay(wsChannel, layerMgr); overlays["Digilines LCD"] = new LcdOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("digilines")) { if (cfg.defaultoverlays.indexOf("digilines") >= 0) {
map.addLayer(overlays["Digilines LCD"]); map.addLayer(overlays["Digilines LCD"]);
} }
} }
if (cfg.mapobjects.digiterms) { if (cfg.mapobjects.digiterms) {
overlays.Digiterms = new DigitermOverlay(wsChannel, layerMgr); overlays.Digiterms = new DigitermOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("digiterms")) { if (cfg.defaultoverlays.indexOf("digiterms") >= 0) {
map.addLayer(overlays.Digiterms); map.addLayer(overlays.Digiterms);
} }
} }
if (cfg.mapobjects.luacontroller) { if (cfg.mapobjects.luacontroller) {
overlays["Lua Controller"] = new LuacontrollerOverlay(wsChannel, layerMgr); overlays["Lua Controller"] = new LuacontrollerOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("luacontroller")) { if (cfg.defaultoverlays.indexOf("luacontroller") >= 0) {
map.addLayer(overlays["Lua Controller"]); map.addLayer(overlays["Lua Controller"]);
} }
} }
if (cfg.mapobjects.technic_anchor) { if (cfg.mapobjects.technic_anchor) {
overlays["Technic Anchor"] = new TechnicAnchorOverlay(wsChannel, layerMgr); overlays["Technic Anchor"] = new TechnicAnchorOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("technic_anchor")) { if (cfg.defaultoverlays.indexOf("technic_anchor") >= 0) {
map.addLayer(overlays["Technic Anchor"]); map.addLayer(overlays["Technic Anchor"]);
} }
} }
if (cfg.mapobjects.technic_quarry) { if (cfg.mapobjects.technic_quarry) {
overlays["Technic Quarry"] = new TechnicQuarryOverlay(wsChannel, layerMgr); overlays["Technic Quarry"] = new TechnicQuarryOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("technic_quarry")) { if (cfg.defaultoverlays.indexOf("technic_quarry") >= 0) {
map.addLayer(overlays["Technic Quarry"]); map.addLayer(overlays["Technic Quarry"]);
} }
} }
if (cfg.mapobjects.technic_switch) { if (cfg.mapobjects.technic_switch) {
overlays["Technic Switching station"] = new TechnicSwitchOverlay(wsChannel, layerMgr); overlays["Technic Switching station"] = new TechnicSwitchOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("technic_switch")) { if (cfg.defaultoverlays.indexOf("technic_switch") >= 0) {
map.addLayer(overlays["Technic Switching station"]); map.addLayer(overlays["Technic Switching station"]);
} }
} }
if (cfg.mapobjects.protector) { if (cfg.mapobjects.protector) {
overlays.Protector = new ProtectorOverlay(wsChannel, layerMgr); overlays.Protector = new ProtectorOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("protector")) { if (cfg.defaultoverlays.indexOf("protector") >= 0) {
map.addLayer(overlays.Protector); map.addLayer(overlays.Protector);
} }
} }
if (cfg.mapobjects.xpprotector) { if (cfg.mapobjects.xpprotector) {
overlays["XP Protector"] = new XPProtectorOverlay(wsChannel, layerMgr); overlays["XP Protector"] = new XPProtectorOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("xpprotector")) { if (cfg.defaultoverlays.indexOf("xpprotector") >= 0) {
map.addLayer(overlays["XP Protector"]); map.addLayer(overlays["XP Protector"]);
} }
} }
if (cfg.mapobjects.privprotector) { if (cfg.mapobjects.privprotector) {
overlays["Priv Protector"] = new PrivProtectorOverlay(wsChannel, layerMgr); overlays["Priv Protector"] = new PrivProtectorOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("privprotector")) { if (cfg.defaultoverlays.indexOf("privprotector") >= 0) {
map.addLayer(overlays["Priv Protector"]); map.addLayer(overlays["Priv Protector"]);
} }
} }
if (cfg.mapobjects.mission) { if (cfg.mapobjects.mission) {
overlays.Missions = new MissionOverlay(wsChannel, layerMgr); overlays.Missions = new MissionOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("mission")) { if (cfg.defaultoverlays.indexOf("mission") >= 0) {
map.addLayer(overlays.Missions); map.addLayer(overlays.Missions);
} }
} }
if (cfg.mapobjects.train) { if (cfg.mapobjects.train) {
overlays.Trains = new TrainOverlay(wsChannel, layerMgr); overlays.Trains = new TrainOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.contains("train")) { if (cfg.defaultoverlays.indexOf("train") >= 0) {
map.addLayer(overlays.Trains); map.addLayer(overlays.Trains);
} }
} }