1
0
forked from MTSR/mapserver

mission overlay

This commit is contained in:
NatureFreshMilk 2019-02-08 15:25:37 +01:00
parent 34ebe37c66
commit 9e145b8711
4 changed files with 28 additions and 4 deletions

View File

@ -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>

View File

@ -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"]);

View 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>";
}
});

View File

@ -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>";
}
});