forked from MTSR/mapserver
shop overlay wip
This commit is contained in:
parent
ba5a08c665
commit
2af121b89b
@ -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) {
|
||||
overlays.Label = new LabelOverlay(wsChannel, layerMgr);
|
||||
if (cfg.defaultoverlays.indexOf("mapserver_label") >= 0) {
|
||||
|
32
server/static/js/overlays/ShopOverlay.js
Normal file
32
server/static/js/overlays/ShopOverlay.js
Normal 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>";
|
||||
}
|
||||
});
|
@ -18,6 +18,7 @@
|
||||
"/js/overlays/AbstractIconOverlay.js",
|
||||
"/js/overlays/AbstractGeoJsonOverlay.js",
|
||||
"/js/overlays/TravelnetOverlay.js",
|
||||
"/js/overlays/ShopOverlay.js",
|
||||
"/js/overlays/PoiOverlay.js",
|
||||
"/js/overlays/LabelOverlay.js",
|
||||
"/js/overlays/PlayerOverlay.js",
|
||||
|
Loading…
Reference in New Issue
Block a user