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