More View2D configuration flexibility
This commit is contained in:
@@ -391,20 +391,20 @@ ol.View2D.createResolutionConstraint_ = function(options) {
|
||||
resolutionConstraint = ol.ResolutionConstraint.createSnapToResolutions(
|
||||
resolutions);
|
||||
} else {
|
||||
var maxZoom, zoomFactor;
|
||||
if (goog.isDef(options.maxResolution) &&
|
||||
goog.isDef(options.maxZoom) &&
|
||||
goog.isDef(options.zoomFactor)) {
|
||||
maxResolution = options.maxResolution;
|
||||
maxZoom = options.maxZoom;
|
||||
zoomFactor = options.zoomFactor;
|
||||
} else {
|
||||
maxResolution = options.maxResolution;
|
||||
if (!goog.isDef(maxResolution)) {
|
||||
var projectionExtent = ol.projection.createProjection(
|
||||
options.projection, 'EPSG:3857').getExtent();
|
||||
maxResolution = Math.max(
|
||||
projectionExtent.maxX - projectionExtent.minX,
|
||||
projectionExtent.maxY - projectionExtent.minY) / ol.DEFAULT_TILE_SIZE;
|
||||
}
|
||||
var maxZoom = options.maxZoom;
|
||||
if (!goog.isDef(maxZoom)) {
|
||||
maxZoom = 28;
|
||||
}
|
||||
var zoomFactor = options.zoomFactor;
|
||||
if (!goog.isDef(zoomFactor)) {
|
||||
zoomFactor = 2;
|
||||
}
|
||||
minResolution = maxResolution / Math.pow(zoomFactor, maxZoom);
|
||||
|
||||
Reference in New Issue
Block a user