1
0
forked from MTSR/mapserver

bones overlay

This commit is contained in:
NatureFreshMilk 2019-02-08 08:27:10 +01:00
parent 627a8f4ef2
commit c9e1b268fb
3 changed files with 23 additions and 0 deletions

View File

@ -36,6 +36,7 @@
<script src="js/overlays/PoiOverlay.js"></script>
<script src="js/overlays/PlayerOverlay.js"></script>
<script src="js/overlays/ProtectorOverlay.js"></script>
<script src="js/overlays/BonesOverlay.js"></script>
<!-- bootstrap -->
<script src="js/main.js"></script>

View File

@ -32,9 +32,12 @@ api.getConfig().then(function(cfg){
overlays["Player"] = new PlayerOverlay(wsChannel, layerMgr);
overlays["POI"] = new PoiOverlay(wsChannel, layerMgr);
overlays["Travelnet"] = new TravelnetOverlay(wsChannel, layerMgr);
overlays["Bones"] = new BonesOverlay(wsChannel, layerMgr);
//overlays["Protector"] = new ProtectorOverlay(wsChannel, layerMgr);
//Default enabled overlays
map.addLayer(overlays["Player"]);
map.addLayer(overlays["POI"]);
L.control.layers(layers, overlays).addTo(map);

View File

@ -0,0 +1,19 @@
'use strict';
var BonesIcon = L.icon({
iconUrl: 'pics/bones_top.png',
iconSize: [16, 16],
iconAnchor: [8, 8],
popupAnchor: [0, -16]
});
var BonesOverlay = AbstractIconOverlay.extend({
initialize: function(wsChannel, layerMgr) {
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "bones", BonesIcon);
},
createPopup: function(bones){
return "<h4>" + bones.attributes.owner + "</h4>";
}
});