show poi on less zoom

This commit is contained in:
Thomas Rudin 2019-03-31 18:19:41 +02:00
parent 91acdec607
commit 49f56c01b0
2 changed files with 9 additions and 1 deletions

View File

@ -47,10 +47,14 @@ var AbstractIconOverlay = L.LayerGroup.extend({
return this.icon;
},
getMaxDisplayedZoom: function(){
return 10;
},
reDraw: function(full){
var self = this;
if (this.map.getZoom() < 10) {
if (this.map.getZoom() < this.getMaxDisplayedZoom()) {
this.clearLayers();
this.currentObjects = {};
return;

View File

@ -16,6 +16,10 @@ var PoiOverlay = AbstractIconOverlay.extend({
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "poi", PoiIcon);
},
getMaxDisplayedZoom: function(){
return 5;
},
createPopup: function(poi){
return "<h4>" + poi.attributes.name + "</h4><hr>" +
"<b>Owner: </b> " + poi.attributes.owner + "<br>";