forked from MTSR/mapserver
mission overlay
This commit is contained in:
parent
34ebe37c66
commit
9e145b8711
@ -43,6 +43,7 @@
|
||||
<script src="js/overlays/LuacontrollerOverlay.js"></script>
|
||||
<script src="js/overlays/TechnicAnchorOverlay.js"></script>
|
||||
<script src="js/overlays/TechnicQuarryOverlay.js"></script>
|
||||
<script src="js/overlays/MissionOverlay.js"></script>
|
||||
|
||||
<!-- bootstrap -->
|
||||
<script src="js/main.js"></script>
|
||||
|
@ -40,6 +40,7 @@ api.getConfig().then(function(cfg){
|
||||
overlays["Technic Anchor"] = new TechnicAnchorOverlay(wsChannel, layerMgr);
|
||||
overlays["Technic Quarry"] = new TechnicQuarryOverlay(wsChannel, layerMgr);
|
||||
overlays["Protector"] = new ProtectorOverlay(wsChannel, layerMgr);
|
||||
overlays["Missions"] = new MissionOverlay(wsChannel, layerMgr);
|
||||
|
||||
//Default enabled overlays
|
||||
map.addLayer(overlays["Player"]);
|
||||
|
22
server/static/js/overlays/MissionOverlay.js
Normal file
22
server/static/js/overlays/MissionOverlay.js
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var MissionIcon = L.icon({
|
||||
iconUrl: 'pics/mission_32px.png',
|
||||
|
||||
iconSize: [32, 32],
|
||||
iconAnchor: [16, 16],
|
||||
popupAnchor: [0, -32]
|
||||
});
|
||||
|
||||
var MissionOverlay = AbstractIconOverlay.extend({
|
||||
initialize: function(wsChannel, layerMgr) {
|
||||
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "mission", MissionIcon);
|
||||
},
|
||||
|
||||
createPopup: function(mission){
|
||||
return "<p>Owner: " + mission.attributes.owner + "</p>" +
|
||||
"<p>Name: " + mission.attributes.name + "</p>" +
|
||||
"<p>Successcount: " + mission.attributes.successcount + "</p>" +
|
||||
"<p>Failcount: " + mission.attributes.failcount + "</p>";
|
||||
}
|
||||
});
|
@ -13,9 +13,9 @@ var TechnicQuarryOverlay = AbstractIconOverlay.extend({
|
||||
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "technicquarry", TechnicQuarryIcon);
|
||||
},
|
||||
|
||||
createPopup: function(lcd){
|
||||
return "<p>Owner: " + lcd.attributes.owner + "</p>" +
|
||||
"<p>Dug: " + lcd.attributes.dug + "</p>" +
|
||||
"<p>Enabled: " + lcd.attributes.enabled + "</p>";
|
||||
createPopup: function(quarry){
|
||||
return "<p>Owner: " + quarry.attributes.owner + "</p>" +
|
||||
"<p>Dug: " + quarry.attributes.dug + "</p>" +
|
||||
"<p>Enabled: " + quarry.attributes.enabled + "</p>";
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user