/* exported LabelOverlay */ /* globals AbstractIconOverlay: true */ var LabelIcon = L.Icon.extend({ initialize: function(options) { L.Icon.prototype.initialize.call(this, options); }, createIcon: function() { var div = document.createElement('div'), options = this.options; div.innerHTML = options.html || ""; div.style.width = "200px"; div.style.height = "200px"; div.style.marginLeft = "-100px"; div.style.marginTop = "-175px"; return div; } }); var LabelOverlay = AbstractIconOverlay.extend({ initialize: function(wsChannel, layerMgr) { AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "label"); }, getIcon: function(lbl){ var height = 200; var width = 200; var fontSize = Math.min(lbl.attributes.size, 20); const html = ` ${lbl.attributes.text} `; return new LabelIcon({ html: html, height: height, width: width }); }, createPopup: function(){} });