From 4f116c2e5b5bb204d37454a6612680d335ab7714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 27 Sep 2012 15:46:45 +0200 Subject: [PATCH] Fix default value of numZoomLevels --- src/ol/mapoptions.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ol/mapoptions.js b/src/ol/mapoptions.js index 7030c03118..96a5c4f70c 100644 --- a/src/ol/mapoptions.js +++ b/src/ol/mapoptions.js @@ -191,8 +191,10 @@ ol.MapOptions.createConstraints_ = function(mapOptionsLiteral) { zoomFactor = mapOptionsLiteral.zoomFactor; } else { maxResolution = ol.Projection.EPSG_3857_HALF_SIZE / 128; - numZoomLevels = 29; - zoomFactor = Math.exp(Math.log(2) / 4); + // number of steps we want between two data resolutions + var numSteps = 4; + numZoomLevels = 29 * numSteps; + zoomFactor = Math.exp(Math.log(2) / numSteps); } resolutionConstraint = ol.ResolutionConstraint.createSnapToPower( zoomFactor, maxResolution, numZoomLevels - 1);