From 78de449b88a9d642b77f97c922664210ca2d2e3a Mon Sep 17 00:00:00 2001 From: David Kolossa Date: Wed, 23 Mar 2016 12:24:35 +0100 Subject: [PATCH] map: fixed display errors on high zoom levels * client dots and labels only showed up on zoom levels up to 18 --- lib/map.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/map.js b/lib/map.js index 43f75b6..9469c1f 100644 --- a/lib/map.js +++ b/lib/map.js @@ -290,6 +290,12 @@ define(["map/clientlayer", "map/labelslayer", } }) + var maxLayerZoom = Math.max.apply(Math, config.mapLayers.map( + function(d) { + return (typeof d.config !== "undefined" && typeof d.config.maxZoom !== "undefined") ? d.config.maxZoom : 18 + })) + + layers[0].layer.addTo(map) layers.forEach( function (d) { @@ -320,11 +326,11 @@ define(["map/clientlayer", "map/labelslayer", d.forEach(addLayer) } - var clientLayer = new ClientLayer({minZoom: 15}) + var clientLayer = new ClientLayer({minZoom: 15, maxZoom: maxLayerZoom}) clientLayer.addTo(map) clientLayer.setZIndex(5) - var labelsLayer = new LabelsLayer() + var labelsLayer = new LabelsLayer({maxZoom: maxLayerZoom}) labelsLayer.addTo(map) labelsLayer.setZIndex(6)