locator overlay
This commit is contained in:
parent
bfa0bf99a0
commit
fdd28c16f5
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
36
server/static/js/overlays/LocatorOverlay.js
Normal file
36
server/static/js/overlays/LocatorOverlay.js
Normal 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>";
|
||||
}
|
||||
});
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user