Update tests
This commit is contained in:
@@ -36,20 +36,6 @@ describe('ol.reproj.Triangulation', function() {
|
|||||||
[20, 20, 30, 30], null, 0);
|
[20, 20, 30, 30], null, 0);
|
||||||
expect(triangulation.getTriangles().length).to.be(2);
|
expect(triangulation.getTriangles().length).to.be(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can handle wrapX in source', function() {
|
|
||||||
proj4.defs('merc_180', '+proj=merc +lon_0=180 +units=m +no_defs');
|
|
||||||
var proj_ = ol.proj.get('merc_180');
|
|
||||||
proj_.setExtent([-20026376.39, -20048966.10, 20026376.39, 20048966.10]);
|
|
||||||
|
|
||||||
var proj4326 = ol.proj.get('EPSG:4326');
|
|
||||||
var triangulation = new ol.reproj.Triangulation(proj4326, proj_,
|
|
||||||
proj_.getExtent(), [-180, -90, 180, 90], 0);
|
|
||||||
expect(triangulation.getWrapsXInSource()).to.be(true);
|
|
||||||
var triExtent = triangulation.calculateSourceExtent();
|
|
||||||
expect(triExtent[2] < triExtent[0]).to.be(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -51,36 +51,6 @@ describe('ol.rendering.reproj.Image', function() {
|
|||||||
'spec/ol/reproj/expected/image-3857-to-4326.png', done);
|
'spec/ol/reproj/expected/image-3857-to-4326.png', done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('dateline wrapping', function() {
|
|
||||||
beforeEach(function() {
|
|
||||||
source = new ol.source.ImageStatic({
|
|
||||||
url: 'spec/ol/data/tiles/4326/0/0/0.png',
|
|
||||||
imageExtent: [-180, -270, 180, 90],
|
|
||||||
projection: ol.proj.get('EPSG:4326')
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('wraps X when prime meridian is shifted', function(done) {
|
|
||||||
proj4.defs('merc_180', '+proj=merc +lon_0=180 +units=m +no_defs');
|
|
||||||
var projExtent = [-20026376.39, -20048966.10, 20026376.39, 20048966.10];
|
|
||||||
|
|
||||||
testSingleImage(source, 'merc_180', projExtent,
|
|
||||||
ol.extent.getWidth(projExtent) / 64, 1,
|
|
||||||
'spec/ol/reproj/expected/image-dateline-merc-180.png', done);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('displays north pole correctly (EPSG:3413)', function(done) {
|
|
||||||
proj4.defs('EPSG:3413', '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 ' +
|
|
||||||
'+k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
|
|
||||||
|
|
||||||
var projExtent = [-4194304, -4194304, 4194304, 4194304];
|
|
||||||
|
|
||||||
testSingleImage(source, 'EPSG:3413', projExtent,
|
|
||||||
ol.extent.getWidth(projExtent) / 64, 1,
|
|
||||||
'spec/ol/reproj/expected/image-dateline-pole.png', done);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
|
|
||||||
var tileGrid = ol.tilegrid.createForProjection('merc_180', 0, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('merc_180', 0, [64, 64]);
|
||||||
testSingleTile(source, 'merc_180', tileGrid, 0, 0, -1, 1,
|
testSingleTile(source, 'merc_180', tileGrid, 0, 0, -1, 1,
|
||||||
'spec/ol/reproj/expected/dateline-merc-180.png', 1, done);
|
'spec/ol/reproj/expected/dateline-merc-180.png', 2, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('displays north pole correctly (EPSG:3413)', function(done) {
|
it('displays north pole correctly (EPSG:3413)', function(done) {
|
||||||
@@ -167,7 +167,7 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
|
|
||||||
var tileGrid = ol.tilegrid.createForProjection('EPSG:3413', 0, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('EPSG:3413', 0, [64, 64]);
|
||||||
testSingleTile(source, 'EPSG:3413', tileGrid, 0, 0, -1, 1,
|
testSingleTile(source, 'EPSG:3413', tileGrid, 0, 0, -1, 1,
|
||||||
'spec/ol/reproj/expected/dateline-pole.png', 1, done);
|
'spec/ol/reproj/expected/dateline-pole.png', 2, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user