locator overlay

This commit is contained in:
NatureFreshMilk 2019-05-14 09:12:06 +02:00
parent bfa0bf99a0
commit fdd28c16f5
4 changed files with 46 additions and 0 deletions

View File

@ -4,6 +4,7 @@
## 2.2.0
* Added ATM overlay
* Added locator overlay
* Add ability for bone-owner search
* Separate mapserver_mod into own repository

View File

@ -149,4 +149,12 @@ function Overlaysetup(cfg, map, overlays, wsChannel, layerMgr){
map.addLayer(overlays.ATM);
}
}
if (cfg.mapobjects.locator) {
overlays.Locator = new LocatorOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.indexOf("locator") >= 0) {
map.addLayer(overlays.Locator);
}
}
}

View File

@ -0,0 +1,36 @@
/* exported ATMOverlay */
/* globals AbstractIconOverlay: true */
var LocatorOverlay = AbstractIconOverlay.extend({
initialize: function(wsChannel, layerMgr) {
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "locator");
},
getMaxDisplayedZoom: function(){
return 6;
},
getIcon: function(obj){
var img = "pics/locator_beacon_level1.png"
if (obj.attributes.level == "2")
img = "pics/locator_beacon_level2.png";
else if (obj.attributes.level == "3")
img = "pics/locator_beacon_level3.png";
L.icon({
iconUrl: img,
iconSize: [32, 32],
iconAnchor: [16, 16],
popupAnchor: [0, -16]
});
},
createPopup: function(obj){
return "<h4>Locator</h4><hr>" +
"<b>Owner: " + obj.attributes.owner + "</b><br>" +
"<b>Name:</b> " + obj.attributes.name + "<br>" +
"<b>Level:</b> " obj.attributes.level "<br>";
}
});

View File

@ -35,6 +35,7 @@
"/js/overlays/PrivProtectorOverlay.js",
"/js/overlays/BonesOverlay.js",
"/js/overlays/LcdOverlay.js",
"/js/overlays/LocatorOverlay.js",
"/js/overlays/DigitermOverlay.js",
"/js/overlays/LuacontrollerOverlay.js",
"/js/overlays/TechnicAnchorOverlay.js",