1
0
forked from MTSR/mapserver

shop overlay wip

This commit is contained in:
Thomas Rudin 2019-04-14 19:58:59 +02:00
parent ba5a08c665
commit 2af121b89b
3 changed files with 40 additions and 0 deletions

View File

@ -17,6 +17,13 @@ function Overlaysetup(cfg, map, overlays, wsChannel, layerMgr){
} }
} }
if (cfg.mapobjects.smartshop || cfg.mapobjects.fancyvend) {
overlays.Shop = new ShopOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.indexOf("smartshop") >= 0 || cfg.defaultoverlays.indexOf("fancyvend") >= 0) {
map.addLayer(overlays.Shop);
}
}
if (cfg.mapobjects.mapserver_label) { if (cfg.mapobjects.mapserver_label) {
overlays.Label = new LabelOverlay(wsChannel, layerMgr); overlays.Label = new LabelOverlay(wsChannel, layerMgr);
if (cfg.defaultoverlays.indexOf("mapserver_label") >= 0) { if (cfg.defaultoverlays.indexOf("mapserver_label") >= 0) {

View File

@ -0,0 +1,32 @@
/* exported ShopOverlay */
/* globals AbstractIconOverlay: true */
var ShopIcon = L.icon({
iconUrl: 'pics/shop.png',
iconSize: [32, 32],
iconAnchor: [16, 16],
popupAnchor: [0, -16]
});
var ShopEmptyIcon = L.icon({
iconUrl: 'pics/shop_empty.png',
iconSize: [32, 32],
iconAnchor: [16, 16],
popupAnchor: [0, -16]
});
var ShopOverlay = AbstractIconOverlay.extend({
initialize: function(wsChannel, layerMgr) {
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "shop", ShopIcon);
},
getMaxDisplayedZoom: function(){
return 5;
},
createPopup: function(poi){
return "<h4>" + poi.attributes.type + "</h4><hr>" +
"<b>Owner: </b> " + poi.attributes.owner + "<br>";
}
});

View File

@ -18,6 +18,7 @@
"/js/overlays/AbstractIconOverlay.js", "/js/overlays/AbstractIconOverlay.js",
"/js/overlays/AbstractGeoJsonOverlay.js", "/js/overlays/AbstractGeoJsonOverlay.js",
"/js/overlays/TravelnetOverlay.js", "/js/overlays/TravelnetOverlay.js",
"/js/overlays/ShopOverlay.js",
"/js/overlays/PoiOverlay.js", "/js/overlays/PoiOverlay.js",
"/js/overlays/LabelOverlay.js", "/js/overlays/LabelOverlay.js",
"/js/overlays/PlayerOverlay.js", "/js/overlays/PlayerOverlay.js",