From 49f56c01b0f49f73a1933d46b042c4c49467881b Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Sun, 31 Mar 2019 18:19:41 +0200 Subject: [PATCH] show poi on less zoom --- server/static/js/overlays/AbstractIconOverlay.js | 6 +++++- server/static/js/overlays/PoiOverlay.js | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/server/static/js/overlays/AbstractIconOverlay.js b/server/static/js/overlays/AbstractIconOverlay.js index b78e576..ca6883c 100644 --- a/server/static/js/overlays/AbstractIconOverlay.js +++ b/server/static/js/overlays/AbstractIconOverlay.js @@ -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; diff --git a/server/static/js/overlays/PoiOverlay.js b/server/static/js/overlays/PoiOverlay.js index c617b15..a0f3bad 100644 --- a/server/static/js/overlays/PoiOverlay.js +++ b/server/static/js/overlays/PoiOverlay.js @@ -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 "

" + poi.attributes.name + "


" + "Owner: " + poi.attributes.owner + "
";