diff --git a/src/ol/source/imagestaticsource.js b/src/ol/source/imagestaticsource.js index 9e0723ea15..a920c4484e 100644 --- a/src/ol/source/imagestaticsource.js +++ b/src/ol/source/imagestaticsource.js @@ -20,7 +20,7 @@ ol.source.ImageStatic = function(options) { var imageExtent = options.imageExtent; var imageSize = options.imageSize; - var imageResolution = (imageExtent[3] - imageExtent[2]) / imageSize[1]; + var imageResolution = (imageExtent[1][1] - imageExtent[0][1]) / imageSize[1]; var projection = ol.proj.get(options.projection); goog.base(this, { diff --git a/src/ol/source/imagewmssource.js b/src/ol/source/imagewmssource.js index d69c5b7be9..dfc3305423 100644 --- a/src/ol/source/imagewmssource.js +++ b/src/ol/source/imagewmssource.js @@ -89,8 +89,8 @@ ol.source.ImageWMS.prototype.getImage = extent = extent.slice(); ol.extent.scaleFromCenter(extent, this.ratio_); - var width = (extent[1] - extent[0]) / resolution; - var height = (extent[3] - extent[2]) / resolution; + var width = (extent[1][0] - extent[0][0]) / resolution; + var height = (extent[1][1] - extent[0][1]) / resolution; var size = [width, height]; this.image_ = this.createImage(extent, resolution, size, projection); diff --git a/src/ol/source/tilejsonsource.js b/src/ol/source/tilejsonsource.js index 337791f970..eb1f91e664 100644 --- a/src/ol/source/tilejsonsource.js +++ b/src/ol/source/tilejsonsource.js @@ -69,15 +69,15 @@ goog.inherits(ol.source.TileJSON, ol.source.TileImage); * @protected */ ol.source.TileJSON.prototype.handleTileJSONResponse = function() { - var tileJSON = ol.tilejson.grids_.pop(); var epsg4326Projection = ol.proj.get('EPSG:4326'); var extent; if (goog.isDef(tileJSON.bounds)) { - var bounds = tileJSON.bounds; - var epsg4326Extent = [bounds[0], bounds[2], bounds[1], bounds[3]]; + var epsg4326Extent = [ + tileJSON.bounds.slice(0, 2), tileJSON.bounds.slice(2) + ]; var transform = ol.proj.getTransformFromProjections( epsg4326Projection, this.getProjection()); extent = ol.extent.transform(epsg4326Extent, transform); diff --git a/src/ol/source/tilewmssource.js b/src/ol/source/tilewmssource.js index 85df962b53..d0853c9540 100644 --- a/src/ol/source/tilewmssource.js +++ b/src/ol/source/tilewmssource.js @@ -75,10 +75,11 @@ ol.source.TileWMS = function(options) { extent = goog.isDef(extent) ? extent : projectionExtent; if (!goog.isNull(extent) && projection.isGlobal() && - extent[0] === projectionExtent[0] && - extent[1] === projectionExtent[1]) { + extent[0][0] === projectionExtent[0][0] && + extent[1][0] === projectionExtent[1][0]) { var numCols = Math.ceil( - (extent[1] - extent[0]) / (tileExtent[1] - tileExtent[0])); + (extent[1][0] - extent[0][0]) / + (tileExtent[1][0] - tileExtent[0][0])); x = goog.math.modulo(x, numCols); tileExtent = tileGrid.getTileCoordExtent( new ol.TileCoord(tileCoord.z, x, tileCoord.y)); diff --git a/src/ol/source/wmssource.js b/src/ol/source/wmssource.js index 07fb1b0cc2..02052e1e6a 100644 --- a/src/ol/source/wmssource.js +++ b/src/ol/source/wmssource.js @@ -54,8 +54,8 @@ ol.source.wms.getUrl = var axisOrientation = projection.getAxisOrientation(); var bboxValues = (wms13 && axisOrientation.substr(0, 2) == 'ne') ? - [extent[2], extent[0], extent[3], extent[1]] : - [extent[0], extent[2], extent[1], extent[3]]; + [extent[0][1], extent[0][0], extent[1][1], extent[1][0]] : + [extent[0][0], extent[0][1], extent[1][0], extent[1][1]]; baseParams['BBOX'] = bboxValues.join(','); return goog.uri.utils.appendParamsFromMap(baseUrl, baseParams); diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 0a44eede2c..0d358f5694 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -154,10 +154,11 @@ ol.source.WMTS = function(options) { options.extent : projectionExtent; if (!goog.isNull(extent) && projection.isGlobal() && - extent[0] === projectionExtent[0] && - extent[1] === projectionExtent[1]) { + extent[0][0] === projectionExtent[0][0] && + extent[1][0] === projectionExtent[1][0]) { var numCols = Math.ceil( - (extent[1] - extent[0]) / (tileExtent[1] - tileExtent[0])); + (extent[1][0] - extent[0][0]) / + (tileExtent[1][0] - tileExtent[0][0])); x = goog.math.modulo(x, numCols); tmpTileCoord.z = tileCoord.z; tmpTileCoord.x = x; diff --git a/test/spec/ol/source/tilesource.test.js b/test/spec/ol/source/tilesource.test.js index 948fc47dc8..d5d05f5c71 100644 --- a/test/spec/ol/source/tilesource.test.js +++ b/test/spec/ol/source/tilesource.test.js @@ -192,7 +192,7 @@ describe('ol.source.Tile', function() { * @param {Object.} loaded Lookup of already loaded tiles. */ ol.test.source.TileMock = function(loaded) { - var extent = [-180, 180, -180, 180]; + var extent = [[-180, -180], [180, 180]]; var tileGrid = new ol.tilegrid.TileGrid({ resolutions: [360 / 256, 180 / 256, 90 / 256, 45 / 256], extent: extent, diff --git a/test/spec/ol/source/vectorsource.test.js b/test/spec/ol/source/vectorsource.test.js index ee40475a22..edb5ce267f 100644 --- a/test/spec/ol/source/vectorsource.test.js +++ b/test/spec/ol/source/vectorsource.test.js @@ -20,7 +20,7 @@ describe('ol.source.Vector', function() { var layer = new ol.layer.Vector({ source: source }); - source.prepareFeatures(layer, [-180, 180, -90, 90], + source.prepareFeatures(layer, [[-180, -90], [180, 90]], ol.proj.get('EPSG:4326'), function() { expect(source.loadState_).to.be(ol.source.VectorLoadState.LOADED); @@ -66,7 +66,7 @@ describe('ol.source.Vector', function() { var layer = new ol.layer.Vector({ source: source }); - source.prepareFeatures(layer, [-180, 180, -90, 90], + source.prepareFeatures(layer, [[-180, -90], [180, 90]], ol.proj.get('EPSG:4326'), function() { expect(source.loadState_).to.be(ol.source.VectorLoadState.LOADED); diff --git a/test/spec/ol/source/wmssource.test.js b/test/spec/ol/source/wmssource.test.js index af93e5c7e8..bfc4ebc9c8 100644 --- a/test/spec/ol/source/wmssource.test.js +++ b/test/spec/ol/source/wmssource.test.js @@ -5,7 +5,7 @@ describe('ol.source.wms', function() { describe('ol.source.wms.getUrl', function() { it('creates expected URL', function() { var epsg3857 = ol.proj.get('EPSG:3857'); - var extent = [-20037508.342789244, 0, -20037508.342789244, 0]; + var extent = [[-20037508.342789244, -20037508.342789244], [0, 0]]; var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' + 'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' + 'foo=bar&STYLES=&CRS=EPSG%3A3857&BBOX=' + @@ -16,7 +16,7 @@ describe('ol.source.wms', function() { }); it('creates expected URL respecting axis orientation', function() { var epsg4326 = ol.proj.get('EPSG:4326'); - var extent = [-180, 0, -90, 90]; + var extent = [[-180, -90], [0, 90]]; var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' + 'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' + 'foo=bar&STYLES=&CRS=EPSG%3A4326&BBOX=-90%2C-180%2C90%2C0';