1
0
forked from MTSR/mapserver
mapserver/public/js/map/overlays/PoiOverlay.js

39 lines
1.0 KiB
JavaScript
Raw Normal View History

2019-06-11 15:01:16 +02:00
import AbstractIconOverlay from './AbstractIconOverlay.js';
2020-04-29 19:51:09 +00:00
import {HtmlSanitizer} from '../../lib/HtmlSanitizer.js';
2019-02-07 07:56:52 +01:00
2019-06-11 15:01:16 +02:00
export default AbstractIconOverlay.extend({
2019-09-18 11:53:58 +02:00
initialize: function() {
AbstractIconOverlay.prototype.initialize.call(this, "poi");
2019-02-07 07:56:52 +01:00
},
2019-05-02 11:09:29 +02:00
getIcon: function(obj){
return L.AwesomeMarkers.icon({
icon: obj.attributes.icon || "home",
prefix: "fa",
markerColor: obj.attributes.color || "blue"
});
},
2019-03-31 18:19:41 +02:00
getMaxDisplayedZoom: function(){
return 5;
},
2019-02-07 07:56:52 +01:00
createPopup: function(poi){
2020-04-29 19:51:09 +00:00
2020-04-28 11:50:36 +00:00
if (poi.attributes.url)
{
2020-04-29 19:51:09 +00:00
return "<a href=\"" + HtmlSanitizer.SanitizeHtml(poi.attributes.url) + "\">" +
"<h4>" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "</h4></a><hr>" +
"<b>Owner: </b> " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "<br>";
2020-04-28 11:50:36 +00:00
}
else
{
2020-04-29 19:51:09 +00:00
return "<h4>" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "</h4><hr>" +
"<b>Owner: </b> " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "<br>";
2020-04-28 11:50:36 +00:00
}
2019-02-07 07:56:52 +01:00
}
2020-04-29 19:51:09 +00:00
2019-02-07 07:56:52 +01:00
});