Fix default value of numZoomLevels

This commit is contained in:
Éric Lemoine
2012-09-27 15:46:45 +02:00
parent b8356f5e2e
commit 4f116c2e5b

View File

@@ -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);