Fix default value of numZoomLevels
This commit is contained in:
@@ -191,8 +191,10 @@ ol.MapOptions.createConstraints_ = function(mapOptionsLiteral) {
|
|||||||
zoomFactor = mapOptionsLiteral.zoomFactor;
|
zoomFactor = mapOptionsLiteral.zoomFactor;
|
||||||
} else {
|
} else {
|
||||||
maxResolution = ol.Projection.EPSG_3857_HALF_SIZE / 128;
|
maxResolution = ol.Projection.EPSG_3857_HALF_SIZE / 128;
|
||||||
numZoomLevels = 29;
|
// number of steps we want between two data resolutions
|
||||||
zoomFactor = Math.exp(Math.log(2) / 4);
|
var numSteps = 4;
|
||||||
|
numZoomLevels = 29 * numSteps;
|
||||||
|
zoomFactor = Math.exp(Math.log(2) / numSteps);
|
||||||
}
|
}
|
||||||
resolutionConstraint = ol.ResolutionConstraint.createSnapToPower(
|
resolutionConstraint = ol.ResolutionConstraint.createSnapToPower(
|
||||||
zoomFactor, maxResolution, numZoomLevels - 1);
|
zoomFactor, maxResolution, numZoomLevels - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user