2019-04-04 11:19:29 +03:00
|
|
|
/* jshint undef: false */
|
|
|
|
/* exported Overlaysetup */
|
2019-02-15 14:47:43 +03:00
|
|
|
|
|
|
|
function Overlaysetup(cfg, map, overlays, wsChannel, layerMgr){
|
|
|
|
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.mapobjects.mapserver_player) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Player = new PlayerOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("mapserver_player")) {
|
|
|
|
map.addLayer(overlays.Player);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.mapserver_poi) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.POI = new PoiOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("mapserver_poi")) {
|
|
|
|
map.addLayer(overlays.POI);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.mapserver_label) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Label = new LabelOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("mapserver_label")) {
|
|
|
|
map.addLayer(overlays.Label);
|
|
|
|
}
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.mapobjects.mapserver_trainline) {
|
|
|
|
overlays.Trainlines = new TrainlineOverlay(wsChannel, layerMgr);
|
|
|
|
if (cfg.defaultoverlays.contains("mapserver_trainline")) {
|
|
|
|
map.addLayer(overlays.Trainlines);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.mapserver_border) {
|
|
|
|
overlays.Border = new BorderOverlay(wsChannel, layerMgr);
|
|
|
|
if (cfg.defaultoverlays.contains("mapserver_border")) {
|
|
|
|
map.addLayer(overlays.Border);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.travelnet) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Travelnet = new TravelnetOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("travelnet")) {
|
|
|
|
map.addLayer(overlays.Travelnet);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.bones) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Bones = new BonesOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("bones")) {
|
|
|
|
map.addLayer(overlays.Bones);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.digilines) {
|
|
|
|
overlays["Digilines LCD"] = new LcdOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("digilines")) {
|
|
|
|
map.addLayer(overlays["Digilines LCD"]);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.digiterms) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Digiterms = new DigitermOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("digiterms")) {
|
|
|
|
map.addLayer(overlays.Digiterms);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.luacontroller) {
|
|
|
|
overlays["Lua Controller"] = new LuacontrollerOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("luacontroller")) {
|
|
|
|
map.addLayer(overlays["Lua Controller"]);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.mapobjects.technic_anchor) {
|
2019-02-15 14:47:43 +03:00
|
|
|
overlays["Technic Anchor"] = new TechnicAnchorOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("technic_anchor")) {
|
|
|
|
map.addLayer(overlays["Technic Anchor"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.technic_quarry) {
|
2019-02-15 14:47:43 +03:00
|
|
|
overlays["Technic Quarry"] = new TechnicQuarryOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("technic_quarry")) {
|
|
|
|
map.addLayer(overlays["Technic Quarry"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.technic_switch) {
|
2019-02-15 14:47:43 +03:00
|
|
|
overlays["Technic Switching station"] = new TechnicSwitchOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("technic_switch")) {
|
|
|
|
map.addLayer(overlays["Technic Switching station"]);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.protector) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Protector = new ProtectorOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("protector")) {
|
|
|
|
map.addLayer(overlays.Protector);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
|
|
|
|
2019-02-27 17:50:23 +03:00
|
|
|
if (cfg.mapobjects.xpprotector) {
|
|
|
|
overlays["XP Protector"] = new XPProtectorOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("xpprotector")) {
|
|
|
|
map.addLayer(overlays["XP Protector"]);
|
|
|
|
}
|
2019-02-27 17:50:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.privprotector) {
|
|
|
|
overlays["Priv Protector"] = new PrivProtectorOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("privprotector")) {
|
|
|
|
map.addLayer(overlays["Priv Protector"]);
|
|
|
|
}
|
2019-02-27 17:50:23 +03:00
|
|
|
}
|
|
|
|
|
2019-02-15 14:47:43 +03:00
|
|
|
if (cfg.mapobjects.mission) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Missions = new MissionOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("mission")) {
|
|
|
|
map.addLayer(overlays.Missions);
|
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-02-24 22:06:20 +03:00
|
|
|
|
|
|
|
if (cfg.mapobjects.train) {
|
2019-04-04 11:19:29 +03:00
|
|
|
overlays.Trains = new TrainOverlay(wsChannel, layerMgr);
|
2019-04-04 13:50:40 +03:00
|
|
|
if (cfg.defaultoverlays.contains("train")) {
|
|
|
|
map.addLayer(overlays.Trains);
|
|
|
|
}
|
2019-02-24 22:06:20 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|