2019-05-14 17:04:42 +03:00
|
|
|
/* exported LocatorOverlay */
|
2019-05-14 10:12:06 +03:00
|
|
|
/* 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){
|
2019-05-14 17:04:42 +03:00
|
|
|
var img = "pics/locator_beacon_level1.png";
|
2019-05-14 10:12:06 +03:00
|
|
|
|
|
|
|
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>" +
|
2019-05-14 17:04:42 +03:00
|
|
|
"<b>Level:</b> " + obj.attributes.level + "<br>";
|
2019-05-14 10:12:06 +03:00
|
|
|
}
|
|
|
|
});
|