diff --git a/doc/changelog.md b/doc/changelog.md index 65f3709..91fbd5f 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -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 diff --git a/server/static/js/Overlaysetup.js b/server/static/js/Overlaysetup.js index 4de1aa1..8b2650b 100644 --- a/server/static/js/Overlaysetup.js +++ b/server/static/js/Overlaysetup.js @@ -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); + } + } + } diff --git a/server/static/js/overlays/LocatorOverlay.js b/server/static/js/overlays/LocatorOverlay.js new file mode 100644 index 0000000..e82a52e --- /dev/null +++ b/server/static/js/overlays/LocatorOverlay.js @@ -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 "