import AbstractIconOverlay from './AbstractIconOverlay.js'; import {HtmlSanitizer} from '../../lib/HtmlSanitizer.js'; export default AbstractIconOverlay.extend({ initialize: function() { AbstractIconOverlay.prototype.initialize.call(this, "poi"); }, getIcon: function(obj){ return L.AwesomeMarkers.icon({ icon: obj.attributes.icon || "home", prefix: "fa", markerColor: obj.attributes.color || "blue" }); }, getMaxDisplayedZoom: function(){ return 5; }, createPopup: function(poi){ var innerHTML = ""; if (poi.attributes.url) { innerHTML += "" + "

" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "

"; } else { innerHTML += "

" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "

"; } if (poi.attributes.image) { innerHTML += "
" + "
"; } innerHTML += "
"; if (poi.attributes.addr) { innerHTML += "Address: " + HtmlSanitizer.SanitizeHtml(poi.attributes.addr) + "
"; } innerHTML += "Owner: " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "
"; return innerHTML; } });