2019-06-11 16:01:16 +03:00
|
|
|
import PlayerOverlay from './overlays/PlayerOverlay.js';
|
|
|
|
import PoiOverlay from './overlays/PoiOverlay.js';
|
|
|
|
import ShopOverlay from './overlays/ShopOverlay.js';
|
|
|
|
import LabelOverlay from './overlays/LabelOverlay.js';
|
|
|
|
import TrainlineOverlay from './overlays/TrainlineOverlay.js';
|
|
|
|
import TravelnetOverlay from './overlays/TravelnetOverlay.js';
|
|
|
|
import BonesOverlay from './overlays/BonesOverlay.js';
|
|
|
|
import LcdOverlay from './overlays/LcdOverlay.js';
|
|
|
|
import DigitermOverlay from './overlays/DigitermOverlay.js';
|
|
|
|
import LuacontrollerOverlay from './overlays/LuacontrollerOverlay.js';
|
|
|
|
import TechnicAnchorOverlay from './overlays/TechnicAnchorOverlay.js';
|
|
|
|
import TechnicQuarryOverlay from './overlays/TechnicQuarryOverlay.js';
|
|
|
|
import TechnicSwitchOverlay from './overlays/TechnicSwitchOverlay.js';
|
|
|
|
import ProtectorOverlay from './overlays/ProtectorOverlay.js';
|
|
|
|
import XPProtectorOverlay from './overlays/XPProtectorOverlay.js';
|
|
|
|
import PrivProtectorOverlay from './overlays/PrivProtectorOverlay.js';
|
|
|
|
import MissionOverlay from './overlays/MissionOverlay.js';
|
|
|
|
import MinecartOverlay from './overlays/MinecartOverlay.js';
|
|
|
|
import ATMOverlay from './overlays/ATMOverlay.js';
|
|
|
|
import LocatorOverlay from './overlays/LocatorOverlay.js';
|
|
|
|
import BorderOverlay from './overlays/BorderOverlay.js';
|
|
|
|
import TrainOverlay from './overlays/TrainOverlay.js';
|
2019-07-25 16:53:47 +03:00
|
|
|
import TrainsignalOverlay from './overlays/TrainsignalOverlay.js';
|
2019-06-11 16:01:16 +03:00
|
|
|
|
2019-09-18 12:53:58 +03:00
|
|
|
export default function(cfg, map, overlays, wsChannel){
|
2019-06-11 16:01:16 +03:00
|
|
|
|
|
|
|
function isDefault(key){
|
|
|
|
return cfg.defaultoverlays.indexOf(key) >= 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.mapserver_player) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Player = new PlayerOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("mapserver_player")) {
|
|
|
|
map.addLayer(overlays.Player);
|
2019-04-04 13:50:40 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cfg.mapobjects.mapserver_poi) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.POI = new PoiOverlay(wsChannel);
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("mapserver_poi")) {
|
|
|
|
map.addLayer(overlays.POI);
|
2019-04-04 13:50:40 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-04-04 13:50:40 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.smartshop || cfg.mapobjects.fancyvend) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Shop = new ShopOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("smartshop") || isDefault("fancyvend")) {
|
|
|
|
map.addLayer(overlays.Shop);
|
2019-04-14 20:58:59 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-04-14 20:58:59 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.mapserver_label) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Label = new LabelOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("mapserver_label")) {
|
|
|
|
map.addLayer(overlays.Label);
|
2019-04-04 13:50:40 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.mapserver_trainline) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Trainlines = new TrainlineOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("mapserver_trainline")) {
|
|
|
|
map.addLayer(overlays.Trainlines);
|
2019-04-04 13:50:40 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-04-04 13:50:40 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.mapserver_border) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Border = new BorderOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("mapserver_border")) {
|
|
|
|
map.addLayer(overlays.Border);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.travelnet) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Travelnet = new TravelnetOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("travelnet")) {
|
|
|
|
map.addLayer(overlays.Travelnet);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.bones) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Bones = new BonesOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("bones")) {
|
|
|
|
map.addLayer(overlays.Bones);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.digilines) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays["Digilines LCD"] = new LcdOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("digilines")) {
|
|
|
|
map.addLayer(overlays["Digilines LCD"]);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.digiterms) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Digiterms = new DigitermOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("digiterms")) {
|
|
|
|
map.addLayer(overlays.Digiterms);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.luacontroller) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays["Lua Controller"] = new LuacontrollerOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("luacontroller")) {
|
|
|
|
map.addLayer(overlays["Lua Controller"]);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.technic_anchor) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays["Technic Anchor"] = new TechnicAnchorOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("technic_anchor")) {
|
|
|
|
map.addLayer(overlays["Technic Anchor"]);
|
2019-04-04 13:50:40 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-04-04 13:50:40 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.technic_quarry) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays["Technic Quarry"] = new TechnicQuarryOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("technic_quarry")) {
|
|
|
|
map.addLayer(overlays["Technic Quarry"]);
|
2019-04-04 13:50:40 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-04-04 13:50:40 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.technic_switch) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays["Technic Switching station"] = new TechnicSwitchOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("technic_switch")) {
|
|
|
|
map.addLayer(overlays["Technic Switching station"]);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.protector) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Protector = new ProtectorOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("protector")) {
|
|
|
|
map.addLayer(overlays.Protector);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-15 14:47:43 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.xpprotector) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays["XP Protector"] = new XPProtectorOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("xpprotector")) {
|
|
|
|
map.addLayer(overlays["XP Protector"]);
|
2019-02-27 17:50:23 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-27 17:50:23 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.privprotector) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays["Priv Protector"] = new PrivProtectorOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("privprotector")) {
|
|
|
|
map.addLayer(overlays["Priv Protector"]);
|
2019-02-27 17:50:23 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-27 17:50:23 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.mission) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Missions = new MissionOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("mission")) {
|
|
|
|
map.addLayer(overlays.Missions);
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-02-24 22:06:20 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.train) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Trains = new TrainOverlay();
|
2019-07-25 16:53:47 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("train")) {
|
|
|
|
map.addLayer(overlays.Trains);
|
2019-02-24 22:06:20 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-04-24 17:21:04 +03:00
|
|
|
|
2019-07-25 16:53:47 +03:00
|
|
|
if (cfg.mapobjects.trainsignal) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Trainsignals = new TrainsignalOverlay();
|
2019-07-25 16:53:47 +03:00
|
|
|
|
|
|
|
if (isDefault("trainsignal")) {
|
|
|
|
map.addLayer(overlays.Trainsignals);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.minecart) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Minecart = new MinecartOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("minecart")) {
|
|
|
|
map.addLayer(overlays.Minecart);
|
2019-04-24 17:21:04 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-05-14 10:01:52 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.atm) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.ATM = new ATMOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("atm")) {
|
|
|
|
map.addLayer(overlays.ATM);
|
2019-05-14 10:01:52 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-05-14 10:12:06 +03:00
|
|
|
|
2019-06-11 16:01:16 +03:00
|
|
|
if (cfg.mapobjects.locator) {
|
2019-09-18 12:53:58 +03:00
|
|
|
overlays.Locator = new LocatorOverlay();
|
2019-06-11 16:01:16 +03:00
|
|
|
if (isDefault("locator")) {
|
|
|
|
map.addLayer(overlays.Locator);
|
2019-05-14 10:12:06 +03:00
|
|
|
}
|
2019-06-11 16:01:16 +03:00
|
|
|
}
|
2019-05-14 10:12:06 +03:00
|
|
|
|
2019-02-15 14:47:43 +03:00
|
|
|
}
|