View2D option "numZoomLevels" changed to "maxZoom"

This is to be consistent with ol.source.XYZ and ol.tilegrid.XYZ.
This commit is contained in:
Éric Lemoine
2013-04-14 22:00:09 +02:00
parent aa69b4bae8
commit 778aec45d8
3 changed files with 11 additions and 11 deletions

View File

@@ -391,12 +391,12 @@ ol.View2D.createResolutionConstraint_ = function(options) {
resolutionConstraint = ol.ResolutionConstraint.createSnapToResolutions(
resolutions);
} else {
var numZoomLevels, zoomFactor;
var maxZoom, zoomFactor;
if (goog.isDef(options.maxResolution) &&
goog.isDef(options.numZoomLevels) &&
goog.isDef(options.maxZoom) &&
goog.isDef(options.zoomFactor)) {
maxResolution = options.maxResolution;
numZoomLevels = options.numZoomLevels;
maxZoom = options.maxZoom;
zoomFactor = options.zoomFactor;
} else {
var projectionExtent = ol.projection.createProjection(
@@ -404,12 +404,12 @@ ol.View2D.createResolutionConstraint_ = function(options) {
maxResolution = Math.max(
projectionExtent.maxX - projectionExtent.minX,
projectionExtent.maxY - projectionExtent.minY) / ol.DEFAULT_TILE_SIZE;
numZoomLevels = 29;
maxZoom = 28;
zoomFactor = 2;
}
minResolution = maxResolution / Math.pow(zoomFactor, numZoomLevels - 1);
minResolution = maxResolution / Math.pow(zoomFactor, maxZoom);
resolutionConstraint = ol.ResolutionConstraint.createSnapToPower(
zoomFactor, maxResolution, numZoomLevels - 1);
zoomFactor, maxResolution, maxZoom);
}
return [resolutionConstraint, maxResolution, minResolution];
};