From e6b395e2ee9503762b9d2226882281f506713a8e Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 3 Sep 2013 17:51:41 -0600 Subject: [PATCH] View support for new extent structure --- src/ol/view2d.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ol/view2d.js b/src/ol/view2d.js index 57f4a976b4..6d5fe6218f 100644 --- a/src/ol/view2d.js +++ b/src/ol/view2d.js @@ -226,7 +226,7 @@ ol.View2D.prototype.calculateExtent = function(size) { var maxX = center[0] + resolution * size[0] / 2; var minY = center[1] - resolution * size[1] / 2; var maxY = center[1] + resolution * size[1] / 2; - return [minX, maxX, minY, maxY]; + return [[minX, minY], [maxX, maxY]]; }; @@ -262,8 +262,8 @@ goog.exportProperty( * @return {number} Resolution. */ ol.View2D.prototype.getResolutionForExtent = function(extent, size) { - var xResolution = (extent[1] - extent[0]) / size[0]; - var yResolution = (extent[3] - extent[2]) / size[1]; + var xResolution = (extent[1][0] - extent[0][0]) / size[0]; + var yResolution = (extent[1][1] - extent[0][1]) / size[1]; return Math.max(xResolution, yResolution); }; @@ -498,8 +498,8 @@ ol.View2D.createResolutionConstraint_ = function(options) { // use an extent that can fit the whole world if need be 360 * ol.METERS_PER_UNIT[ol.ProjectionUnits.DEGREES] / ol.METERS_PER_UNIT[projection.getUnits()] : - Math.max(projectionExtent[1] - projectionExtent[0], - projectionExtent[3] - projectionExtent[2]); + Math.max(projectionExtent[1][0] - projectionExtent[0][0], + projectionExtent[1][1] - projectionExtent[0][1]); maxResolution = size / ol.DEFAULT_TILE_SIZE; } var maxZoom = options.maxZoom;