diff --git a/src/ol/source/GeoTIFF.js b/src/ol/source/GeoTIFF.js index 784cc28852..88b81a6657 100644 --- a/src/ol/source/GeoTIFF.js +++ b/src/ol/source/GeoTIFF.js @@ -300,6 +300,7 @@ function getMaxForDataType(array) { * @property {boolean} [opaque=false] Whether the layer is opaque. * @property {number} [transition=250] Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. + * @property {boolean} [wrapX=false] Render tiles beyond the tile grid extent. */ /** @@ -318,6 +319,7 @@ class GeoTIFFSource extends DataTile { projection: null, opaque: options.opaque, transition: options.transition, + wrapX: options.wrapX, }); /** diff --git a/test/browser/spec/ol/source/GeoTIFF.test.js b/test/browser/spec/ol/source/GeoTIFF.test.js index 2ad410dacf..778f965956 100644 --- a/test/browser/spec/ol/source/GeoTIFF.test.js +++ b/test/browser/spec/ol/source/GeoTIFF.test.js @@ -27,6 +27,29 @@ describe('ol/source/GeoTIFF', function () { expect(source.readMethod_).to.be('readRGB'); }); + it('defaults to wrapX: false', function () { + const source = new GeoTIFFSource({ + sources: [ + { + url: 'spec/ol/source/images/0-0-0.tif', + }, + ], + }); + expect(source.getWrapX()).to.be(false); + }); + + it('allows wrapX to be set', function () { + const source = new GeoTIFFSource({ + wrapX: true, + sources: [ + { + url: 'spec/ol/source/images/0-0-0.tif', + }, + ], + }); + expect(source.getWrapX()).to.be(true); + }); + it('generates Float32Array data if normalize is set to false', (done) => { const source = new GeoTIFFSource({ normalize: false,