Run rendering tests with the rest of the tests
@@ -12,7 +12,7 @@
|
|||||||
"install": "node tasks/install.js",
|
"install": "node tasks/install.js",
|
||||||
"postinstall": "closure-util update",
|
"postinstall": "closure-util update",
|
||||||
"start": "node tasks/serve.js",
|
"start": "node tasks/serve.js",
|
||||||
"pretest": "eslint tasks test test_rendering src examples",
|
"pretest": "eslint tasks test src examples",
|
||||||
"lint-package": "eslint --fix build/package",
|
"lint-package": "eslint --fix build/package",
|
||||||
"test": "node tasks/test.js",
|
"test": "node tasks/test.js",
|
||||||
"debug-server": "node tasks/serve-lib.js",
|
"debug-server": "node tasks/serve-lib.js",
|
||||||
|
|||||||
@@ -1,11 +1,23 @@
|
|||||||
{
|
{
|
||||||
|
"env": {
|
||||||
|
"mocha": true
|
||||||
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"openlayers-internal/no-missing-requires": 0,
|
"openlayers-internal/no-missing-requires": 0,
|
||||||
"openlayers-internal/valid-provide": 0
|
"openlayers-internal/valid-provide": 0
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
|
"IMAGE_TOLERANCE": false,
|
||||||
|
"afterLoadText": false,
|
||||||
|
"assertWebGL": false,
|
||||||
"createMapDiv": true,
|
"createMapDiv": true,
|
||||||
"disposeMap": true,
|
"disposeMap": true,
|
||||||
"resemble": true
|
"expect": false,
|
||||||
|
"expectResemble": false,
|
||||||
|
"proj4": false,
|
||||||
|
"resemble": false,
|
||||||
|
"resembleCanvas": false,
|
||||||
|
"sinon": false,
|
||||||
|
"where": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,3 +32,26 @@ any time one of the source or spec files changes.
|
|||||||
Tip for TDD'ers: to make PhantomJS run the test suite continuously each time
|
Tip for TDD'ers: to make PhantomJS run the test suite continuously each time
|
||||||
a spec file is changed you can use nosier (http://pypi.python.org/pypi/nosier)
|
a spec file is changed you can use nosier (http://pypi.python.org/pypi/nosier)
|
||||||
and do `nosier -p test -p src "make test"`.
|
and do `nosier -p test -p src "make test"`.
|
||||||
|
|
||||||
|
# Rendering tests
|
||||||
|
|
||||||
|
The `test/rendering` directory contains rendering tests which compare a rendered map with a
|
||||||
|
reference image using [resemble.js](http://huddle.github.io/Resemble.js/).
|
||||||
|
|
||||||
|
To run the tests in the browser, make sure the development server is running
|
||||||
|
(`make serve`) and open the URL
|
||||||
|
[http://localhost:3000/test_rendering/index.html](http://localhost:3000/test_rendering/index.html).
|
||||||
|
|
||||||
|
From the command-line the tests can be run with the build target `make test-rendering`.
|
||||||
|
|
||||||
|
## Adding new tests
|
||||||
|
When creating a new test case, a reference image has to be created. By appending `?generate`
|
||||||
|
to the URL, a canvas with the rendered map will be shown on the page when calling
|
||||||
|
`expectResemble`. Then the reference image can simply be created with a right-click
|
||||||
|
and "Save image as".
|
||||||
|
|
||||||
|
It is recommended to only run a single test case when generating the reference image.
|
||||||
|
|
||||||
|
## Image difference
|
||||||
|
When a test fails, an image showing the difference between the reference image and the
|
||||||
|
rendered map can be displayed by appending `?showdiff` to the URL.
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ module.exports = function(karma) {
|
|||||||
}, {
|
}, {
|
||||||
pattern: path.resolve(__dirname, require.resolve('proj4/dist/proj4.js')),
|
pattern: path.resolve(__dirname, require.resolve('proj4/dist/proj4.js')),
|
||||||
watched: false
|
watched: false
|
||||||
|
}, {
|
||||||
|
pattern: path.resolve(__dirname, require.resolve('resemblejs/resemble.js')),
|
||||||
|
watched: false
|
||||||
}, {
|
}, {
|
||||||
pattern: path.resolve(__dirname, './test-extensions.js')
|
pattern: path.resolve(__dirname, './test-extensions.js')
|
||||||
}, {
|
}, {
|
||||||
@@ -39,6 +42,7 @@ module.exports = function(karma) {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
proxies: {
|
proxies: {
|
||||||
|
'/rendering/': '/base/rendering/',
|
||||||
'/spec/': '/base/spec/'
|
'/spec/': '/base/spec/'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 635 B |
|
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 838 B |
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 637 B |
|
Before Width: | Height: | Size: 950 B After Width: | Height: | Size: 950 B |
|
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |
|
Before Width: | Height: | Size: 966 B After Width: | Height: | Size: 966 B |
|
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 717 B |
|
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 792 B |
|
Before Width: | Height: | Size: 801 B After Width: | Height: | Size: 801 B |
|
Before Width: | Height: | Size: 615 B After Width: | Height: | Size: 615 B |
|
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 733 B |
|
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 639 B |
|
Before Width: | Height: | Size: 799 B After Width: | Height: | Size: 799 B |
@@ -57,7 +57,7 @@ describe('layer clipping', function() {
|
|||||||
it('clips to all parts of the MultiPolygon', function(done) {
|
it('clips to all parts of the MultiPolygon', function(done) {
|
||||||
|
|
||||||
var source = new ol.source.XYZ({
|
var source = new ol.source.XYZ({
|
||||||
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
|
|
||||||
var layer = new ol.layer.Tile({
|
var layer = new ol.layer.Tile({
|
||||||
@@ -100,7 +100,7 @@ describe('layer clipping', function() {
|
|||||||
if (err) {
|
if (err) {
|
||||||
return done(err);
|
return done(err);
|
||||||
}
|
}
|
||||||
expectResemble(map, 'spec/ol/layer/expected/multipolygon-clip.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/layer/expected/multipolygon-clip.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 254 B |
|
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 504 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -63,7 +63,7 @@ describe('ol.rendering.layer.Image', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.ImageStatic({
|
source = new ol.source.ImageStatic({
|
||||||
url: 'spec/ol/data/tiles/osm/5/5/12.png',
|
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
|
||||||
imageExtent: ol.tilegrid.createXYZ().getTileCoordExtent(
|
imageExtent: ol.tilegrid.createXYZ().getTileCoordExtent(
|
||||||
[5, 5, -12 - 1]),
|
[5, 5, -12 - 1]),
|
||||||
projection: ol.proj.get('EPSG:3857')
|
projection: ol.proj.get('EPSG:3857')
|
||||||
@@ -77,7 +77,7 @@ describe('ol.rendering.layer.Image', function() {
|
|||||||
it('tests the canvas renderer', function(done) {
|
it('tests the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
waitForImages([source], {}, function() {
|
waitForImages([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/image-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/image-canvas.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -86,7 +86,7 @@ describe('ol.rendering.layer.Image', function() {
|
|||||||
assertWebGL();
|
assertWebGL();
|
||||||
map = createMap('webgl');
|
map = createMap('webgl');
|
||||||
waitForImages([source], {}, function() {
|
waitForImages([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/image-webgl.png',
|
expectResemble(map, 'rendering/ol/layer/expected/image-webgl.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -97,7 +97,7 @@ describe('ol.rendering.layer.Image', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.ImageStatic({
|
source = new ol.source.ImageStatic({
|
||||||
url: 'spec/ol/data/tiles/osm/5/5/12.png',
|
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
|
||||||
imageExtent: ol.proj.transformExtent(
|
imageExtent: ol.proj.transformExtent(
|
||||||
[-123, 37, -122, 38], 'EPSG:4326', 'EPSG:3857')
|
[-123, 37, -122, 38], 'EPSG:4326', 'EPSG:3857')
|
||||||
});
|
});
|
||||||
@@ -110,7 +110,7 @@ describe('ol.rendering.layer.Image', function() {
|
|||||||
it('renders correctly', function(done) {
|
it('renders correctly', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
waitForImages([source], {}, function() {
|
waitForImages([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/image-scaled.png',
|
expectResemble(map, 'rendering/ol/layer/expected/image-scaled.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -72,7 +72,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
it('tests the canvas renderer', function(done) {
|
it('tests the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
waitForTiles([source], {}, function() {
|
waitForTiles([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/osm-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/osm-canvas.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -92,7 +92,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
assertWebGL();
|
assertWebGL();
|
||||||
map = createMap('webgl');
|
map = createMap('webgl');
|
||||||
waitForTiles([source], {}, function() {
|
waitForTiles([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/osm-webgl.png',
|
expectResemble(map, 'rendering/ol/layer/expected/osm-webgl.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -103,10 +103,10 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source1 = new ol.source.XYZ({
|
source1 = new ol.source.XYZ({
|
||||||
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
source2 = new ol.source.XYZ({
|
source2 = new ol.source.XYZ({
|
||||||
url: 'spec/ol/data/tiles/stamen-labels/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/stamen-labels/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
it('tests the canvas renderer', function(done) {
|
it('tests the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
waitForTiles([source1, source2], {}, function() {
|
waitForTiles([source1, source2], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -126,7 +126,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
assertWebGL();
|
assertWebGL();
|
||||||
map = createMap('webgl');
|
map = createMap('webgl');
|
||||||
waitForTiles([source1, source2], {}, function() {
|
waitForTiles([source1, source2], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/2-layers-webgl.png',
|
expectResemble(map, 'rendering/ol/layer/expected/2-layers-webgl.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -141,7 +141,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
it('tests canvas layer extent clipping', function(done) {
|
it('tests canvas layer extent clipping', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent.png',
|
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -150,7 +150,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
map.getView().setRotation(Math.PI / 2);
|
map.getView().setRotation(Math.PI / 2);
|
||||||
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent-rotate.png',
|
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent-rotate.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -158,7 +158,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
it('tests canvas layer extent clipping (HiDPI)', function(done) {
|
it('tests canvas layer extent clipping (HiDPI)', function(done) {
|
||||||
map = createMap('canvas', undefined, undefined, 2);
|
map = createMap('canvas', undefined, undefined, 2);
|
||||||
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent-hidpi.png',
|
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent-hidpi.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -167,7 +167,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
map = createMap('canvas', undefined, undefined, 2);
|
map = createMap('canvas', undefined, undefined, 2);
|
||||||
map.getView().setRotation(Math.PI / 2);
|
map.getView().setRotation(Math.PI / 2);
|
||||||
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent-rotate-hidpi.png',
|
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent-rotate-hidpi.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -179,7 +179,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
it('tests the canvas renderer', function(done) {
|
it('tests the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
waitForTiles([source], {opacity: 0.2}, function() {
|
waitForTiles([source], {opacity: 0.2}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/opacity-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/opacity-canvas.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -199,7 +199,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
assertWebGL();
|
assertWebGL();
|
||||||
map = createMap('webgl');
|
map = createMap('webgl');
|
||||||
waitForTiles([source], {opacity: 0.2}, function() {
|
waitForTiles([source], {opacity: 0.2}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/opacity-webgl.png',
|
expectResemble(map, 'rendering/ol/layer/expected/opacity-webgl.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -209,7 +209,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
|
|
||||||
function createSource(tileSize) {
|
function createSource(tileSize) {
|
||||||
return new ol.source.TileImage({
|
return new ol.source.TileImage({
|
||||||
url: 'spec/ol/data/tiles/' + tileSize + '/{z}/{x}/{y}.png',
|
url: 'rendering/ol/data/tiles/' + tileSize + '/{z}/{x}/{y}.png',
|
||||||
tileGrid: ol.tilegrid.createXYZ({
|
tileGrid: ol.tilegrid.createXYZ({
|
||||||
tileSize: tileSize.split('x')
|
tileSize: tileSize.split('x')
|
||||||
})
|
})
|
||||||
@@ -224,7 +224,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
var source = createSource('512x256');
|
var source = createSource('512x256');
|
||||||
map = createMap('canvas', [-10997148, 4569099]);
|
map = createMap('canvas', [-10997148, 4569099]);
|
||||||
waitForTiles([source], {}, function() {
|
waitForTiles([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/512x256-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/512x256-canvas.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -234,7 +234,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
var source = createSource('512x256');
|
var source = createSource('512x256');
|
||||||
map = createMap('webgl', [-10997148, 4569099]);
|
map = createMap('webgl', [-10997148, 4569099]);
|
||||||
waitForTiles([source], {}, function() {
|
waitForTiles([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/512x256-webgl.png',
|
expectResemble(map, 'rendering/ol/layer/expected/512x256-webgl.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -244,7 +244,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
map = createMap('canvas', [-11271098, 3747248], [100, 100], undefined,
|
map = createMap('canvas', [-11271098, 3747248], [100, 100], undefined,
|
||||||
source.getTileGrid().getResolutions());
|
source.getTileGrid().getResolutions());
|
||||||
waitForTiles([source], {}, function() {
|
waitForTiles([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/192x256-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/192x256-canvas.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -255,7 +255,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
map = createMap('webgl', [-11271098, 3747248], [100, 100], undefined,
|
map = createMap('webgl', [-11271098, 3747248], [100, 100], undefined,
|
||||||
source.getTileGrid().getResolutions());
|
source.getTileGrid().getResolutions());
|
||||||
waitForTiles([source], {}, function() {
|
waitForTiles([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/192x256-webgl.png',
|
expectResemble(map, 'rendering/ol/layer/expected/192x256-webgl.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -266,7 +266,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
onAddLayer = function(evt) {
|
onAddLayer = function(evt) {
|
||||||
evt.element.on('render', function(e) {
|
evt.element.on('render', function(e) {
|
||||||
@@ -290,7 +290,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
map = createMap('canvas', undefined, [100, 100]);
|
map = createMap('canvas', undefined, [100, 100]);
|
||||||
map.getLayers().on('add', onAddLayer);
|
map.getLayers().on('add', onAddLayer);
|
||||||
waitForTiles([source], {}, function() {
|
waitForTiles([source], {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/render-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/render-canvas.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -92,7 +92,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
source: source
|
source: source
|
||||||
}));
|
}));
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vector-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas.png',
|
||||||
17, done);
|
17, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -151,7 +151,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-rotated.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-rotated.png',
|
||||||
1.7, done);
|
1.7, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -177,7 +177,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-opaque.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-opaque.png',
|
||||||
24.34, done);
|
24.34, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -201,7 +201,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-stroke.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-stroke.png',
|
||||||
7, done);
|
7, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -252,9 +252,9 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
var referenceImage = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height);
|
var referenceImage = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height);
|
||||||
// now render the same with `overlaps: false`
|
// now render the same with `overlaps: false`
|
||||||
layer.setSource(createSource(false));
|
layer.setSource(createSource(false));
|
||||||
// result should be exactly the same as with `overlaps: true`
|
// result should be similar to `overlaps: true`
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, referenceImage, 0, done);
|
expectResemble(map, referenceImage, 2, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -362,7 +362,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/inverted-star.png', 1, done);
|
expectResemble(map, 'rendering/ol/layer/expected/inverted-star.png', 1, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -424,7 +424,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-simplified.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-simplified.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -436,7 +436,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-simplified-fill.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-simplified-fill.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -449,7 +449,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-simplified-stroke.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-simplified-stroke.png',
|
||||||
IMAGE_TOLERANCE, done);
|
IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -64,7 +64,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
format: new ol.format.MVT(),
|
format: new ol.format.MVT(),
|
||||||
tileGrid: ol.tilegrid.createXYZ(),
|
tileGrid: ol.tilegrid.createXYZ(),
|
||||||
tilePixelRatio: 16,
|
tilePixelRatio: 16,
|
||||||
url: 'spec/ol/data/tiles/mvt/{z}-{x}-{y}.vector.pbf'
|
url: 'rendering/ol/data/tiles/mvt/{z}-{x}-{y}.vector.pbf'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
it('renders correctly with the canvas renderer', function(done) {
|
it('renders correctly with the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
waitForTiles(source, {}, function() {
|
waitForTiles(source, {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas.png',
|
||||||
11.7, done);
|
11.7, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -84,7 +84,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
map.getView().setRotation(Math.PI / 4);
|
map.getView().setRotation(Math.PI / 4);
|
||||||
waitForTiles(source, {}, function() {
|
waitForTiles(source, {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-rotated.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas-rotated.png',
|
||||||
13.4, done);
|
13.4, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -92,7 +92,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
it('renders correctly with the canvas renderer (HiDPI)', function(done) {
|
it('renders correctly with the canvas renderer (HiDPI)', function(done) {
|
||||||
map = createMap('canvas', 2);
|
map = createMap('canvas', 2);
|
||||||
waitForTiles(source, {}, function() {
|
waitForTiles(source, {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-hidpi.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas-hidpi.png',
|
||||||
11.3, done);
|
11.3, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -101,7 +101,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
map = createMap('canvas', 2);
|
map = createMap('canvas', 2);
|
||||||
map.getView().setRotation(Math.PI / 4);
|
map.getView().setRotation(Math.PI / 4);
|
||||||
waitForTiles(source, {}, function() {
|
waitForTiles(source, {}, function() {
|
||||||
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-rotated-hidpi.png',
|
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas-rotated-hidpi.png',
|
||||||
14.8, done);
|
14.8, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -89,14 +89,14 @@ describe('ol.rendering.Map', function() {
|
|||||||
it('tests the canvas renderer', function(done) {
|
it('tests the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/render-canvas.png', IMAGE_TOLERANCE, done);
|
map, 'rendering/ol/expected/render-canvas.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('tests the WebGL renderer', function(done) {
|
it('tests the WebGL renderer', function(done) {
|
||||||
assertWebGL();
|
assertWebGL();
|
||||||
map = createMap('webgl');
|
map = createMap('webgl');
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/render-webgl.png', IMAGE_TOLERANCE, done);
|
map, 'rendering/ol/expected/render-webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ describe('ol.rendering.Map', function() {
|
|||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
map.getView().setCenter([10, 10]);
|
map.getView().setCenter([10, 10]);
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/pan-canvas.png', IMAGE_TOLERANCE, done);
|
map, 'rendering/ol/expected/pan-canvas.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('tests the WebGL renderer', function(done) {
|
it('tests the WebGL renderer', function(done) {
|
||||||
@@ -117,7 +117,7 @@ describe('ol.rendering.Map', function() {
|
|||||||
map = createMap('webgl');
|
map = createMap('webgl');
|
||||||
map.getView().setCenter([10, 10]);
|
map.getView().setCenter([10, 10]);
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/pan-webgl.png', IMAGE_TOLERANCE, done);
|
map, 'rendering/ol/expected/pan-webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ describe('ol.rendering.Map', function() {
|
|||||||
map.getView().setRotation(90);
|
map.getView().setRotation(90);
|
||||||
map.getView().setCenter([10, 10]);
|
map.getView().setCenter([10, 10]);
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/rotate-canvas.png', 2.8, done);
|
map, 'rendering/ol/expected/rotate-canvas.png', 2.8, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('tests the WebGL renderer', function(done) {
|
it('tests the WebGL renderer', function(done) {
|
||||||
@@ -140,7 +140,7 @@ describe('ol.rendering.Map', function() {
|
|||||||
map.getView().setRotation(90);
|
map.getView().setRotation(90);
|
||||||
map.getView().setCenter([10, 10]);
|
map.getView().setCenter([10, 10]);
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/rotate-webgl.png', IMAGE_TOLERANCE, done);
|
map, 'rendering/ol/expected/rotate-webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ describe('ol.rendering.Map', function() {
|
|||||||
map.getView().setCenter([10, 10]);
|
map.getView().setCenter([10, 10]);
|
||||||
map.getView().setResolution(2);
|
map.getView().setResolution(2);
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/zoom-canvas.png', IMAGE_TOLERANCE, done);
|
map, 'rendering/ol/expected/zoom-canvas.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('tests the WebGL renderer', function(done) {
|
it('tests the WebGL renderer', function(done) {
|
||||||
@@ -163,7 +163,7 @@ describe('ol.rendering.Map', function() {
|
|||||||
map.getView().setCenter([10, 10]);
|
map.getView().setCenter([10, 10]);
|
||||||
map.getView().setResolution(2);
|
map.getView().setResolution(2);
|
||||||
expectResemble(
|
expectResemble(
|
||||||
map, 'spec/ol/expected/zoom-webgl.png', IMAGE_TOLERANCE, done);
|
map, 'rendering/ol/expected/zoom-webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -44,7 +44,7 @@ describe('ol.render', function() {
|
|||||||
vectorContext.drawGeometry(new ol.geom.Point([50, 50]));
|
vectorContext.drawGeometry(new ol.geom.Point([50, 50]));
|
||||||
|
|
||||||
resembleCanvas(context.canvas,
|
resembleCanvas(context.canvas,
|
||||||
'spec/ol/expected/render-point.png', IMAGE_TOLERANCE, done);
|
'rendering/ol/expected/render-point.png', IMAGE_TOLERANCE, done);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ describe('ol.render', function() {
|
|||||||
]));
|
]));
|
||||||
|
|
||||||
resembleCanvas(context.canvas,
|
resembleCanvas(context.canvas,
|
||||||
'spec/ol/expected/render-linestring.png', IMAGE_TOLERANCE, done);
|
'rendering/ol/expected/render-linestring.png', IMAGE_TOLERANCE, done);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ describe('ol.render', function() {
|
|||||||
]));
|
]));
|
||||||
|
|
||||||
resembleCanvas(context.canvas,
|
resembleCanvas(context.canvas,
|
||||||
'spec/ol/expected/render-linestring-butt.png', IMAGE_TOLERANCE, done);
|
'rendering/ol/expected/render-linestring-butt.png', IMAGE_TOLERANCE, done);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ describe('ol.render', function() {
|
|||||||
]));
|
]));
|
||||||
|
|
||||||
resembleCanvas(context.canvas,
|
resembleCanvas(context.canvas,
|
||||||
'spec/ol/expected/render-linestring-bevel.png', IMAGE_TOLERANCE, done);
|
'rendering/ol/expected/render-linestring-bevel.png', IMAGE_TOLERANCE, done);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ describe('ol.render', function() {
|
|||||||
]));
|
]));
|
||||||
|
|
||||||
resembleCanvas(context.canvas,
|
resembleCanvas(context.canvas,
|
||||||
'spec/ol/expected/render-polygon.png', IMAGE_TOLERANCE, done);
|
'rendering/ol/expected/render-polygon.png', IMAGE_TOLERANCE, done);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -38,7 +38,7 @@ describe('ol.rendering.reproj.Image', function() {
|
|||||||
describe('image reprojections from EPSG:3857', function() {
|
describe('image reprojections from EPSG:3857', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.ImageStatic({
|
source = new ol.source.ImageStatic({
|
||||||
url: 'spec/ol/data/tiles/osm/5/5/12.png',
|
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
|
||||||
imageExtent: ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
|
imageExtent: ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
|
||||||
projection: ol.proj.get('EPSG:3857')
|
projection: ol.proj.get('EPSG:3857')
|
||||||
});
|
});
|
||||||
@@ -48,7 +48,7 @@ describe('ol.rendering.reproj.Image', function() {
|
|||||||
testSingleImage(source, 'EPSG:3857',
|
testSingleImage(source, 'EPSG:3857',
|
||||||
ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
|
ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
|
||||||
2 * ol.proj.EPSG3857.HALF_SIZE / (256 * (1 << 5)), 1,
|
2 * ol.proj.EPSG3857.HALF_SIZE / (256 * (1 << 5)), 1,
|
||||||
'spec/ol/data/tiles/osm/5/5/12.png', done);
|
'rendering/ol/data/tiles/osm/5/5/12.png', done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to EPSG:4326', function(done) {
|
it('to EPSG:4326', function(done) {
|
||||||
@@ -56,7 +56,7 @@ describe('ol.rendering.reproj.Image', function() {
|
|||||||
ol.tilegrid.createForProjection('EPSG:4326').
|
ol.tilegrid.createForProjection('EPSG:4326').
|
||||||
getTileCoordExtent([6, 10, -10]),
|
getTileCoordExtent([6, 10, -10]),
|
||||||
360 / (256 * (1 << 4)), 1,
|
360 / (256 * (1 << 4)), 1,
|
||||||
'spec/ol/reproj/expected/image-3857-to-4326.png', done);
|
'rendering/ol/reproj/expected/image-3857-to-4326.png', done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -41,19 +41,19 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('works for identity reprojection', function(done) {
|
it('works for identity reprojection', function(done) {
|
||||||
testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 5, -13, 1,
|
testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 5, -13, 1,
|
||||||
'spec/ol/data/tiles/osm/5/5/12.png', 1, done);
|
'rendering/ol/data/tiles/osm/5/5/12.png', 1, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to EPSG:4326', function(done) {
|
it('to EPSG:4326', function(done) {
|
||||||
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]);
|
||||||
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 21, -20, 1,
|
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 21, -20, 1,
|
||||||
'spec/ol/reproj/expected/osm4326.png', 1, done);
|
'rendering/ol/reproj/expected/osm4326.png', 1, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to EPSG:5070', function(done) {
|
it('to EPSG:5070', function(done) {
|
||||||
@@ -65,7 +65,7 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
|
|
||||||
var tileGrid = ol.tilegrid.createForProjection('EPSG:5070', 5, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('EPSG:5070', 5, [64, 64]);
|
||||||
testSingleTile(source, 'EPSG:5070', tileGrid, 5, 13, -15, 1,
|
testSingleTile(source, 'EPSG:5070', tileGrid, 5, 13, -15, 1,
|
||||||
'spec/ol/reproj/expected/osm5070.png', 1, done);
|
'rendering/ol/reproj/expected/osm5070.png', 1, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to ESRI:54009', function(done) {
|
it('to ESRI:54009', function(done) {
|
||||||
@@ -76,7 +76,7 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
|
|
||||||
var tileGrid = ol.tilegrid.createForProjection('ESRI:54009', 7, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('ESRI:54009', 7, [64, 64]);
|
||||||
testSingleTile(source, 'ESRI:54009', tileGrid, 7, 27, -16, 1,
|
testSingleTile(source, 'ESRI:54009', tileGrid, 7, 27, -16, 1,
|
||||||
'spec/ol/reproj/expected/osm54009.png', 1, done);
|
'rendering/ol/reproj/expected/osm54009.png', 1, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -84,14 +84,14 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to EPSG:4326', function(done) {
|
it('to EPSG:4326', function(done) {
|
||||||
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]);
|
||||||
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 23, -21, 1,
|
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 23, -21, 1,
|
||||||
'spec/ol/reproj/expected/stitch-osm4326.png', 2, done);
|
'rendering/ol/reproj/expected/stitch-osm4326.png', 2, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to EPSG:3740', function(done) {
|
it('to EPSG:3740', function(done) {
|
||||||
@@ -103,7 +103,7 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
|
|
||||||
var tileGrid = ol.tilegrid.createForProjection('EPSG:3740', 4, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('EPSG:3740', 4, [64, 64]);
|
||||||
testSingleTile(source, 'EPSG:3740', tileGrid, 4, 4, -13, 1,
|
testSingleTile(source, 'EPSG:3740', tileGrid, 4, 4, -13, 1,
|
||||||
'spec/ol/reproj/expected/stitch-osm3740.png', 4, done);
|
'rendering/ol/reproj/expected/stitch-osm3740.png', 4, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -112,19 +112,19 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
projection: 'EPSG:4326',
|
projection: 'EPSG:4326',
|
||||||
maxZoom: 0,
|
maxZoom: 0,
|
||||||
url: 'spec/ol/data/tiles/4326/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/4326/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('works for identity reprojection', function(done) {
|
it('works for identity reprojection', function(done) {
|
||||||
testSingleTile(source, 'EPSG:4326', source.getTileGrid(), 0, 0, -1, 1,
|
testSingleTile(source, 'EPSG:4326', source.getTileGrid(), 0, 0, -1, 1,
|
||||||
'spec/ol/data/tiles/4326/0/0/0.png', 1, done);
|
'rendering/ol/data/tiles/4326/0/0/0.png', 1, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to EPSG:3857', function(done) {
|
it('to EPSG:3857', function(done) {
|
||||||
var tileGrid = ol.tilegrid.createForProjection('EPSG:3857', 0, [64, 64]);
|
var tileGrid = ol.tilegrid.createForProjection('EPSG:3857', 0, [64, 64]);
|
||||||
testSingleTile(source, 'EPSG:3857', tileGrid, 0, 0, -1, 1,
|
testSingleTile(source, 'EPSG:3857', tileGrid, 0, 0, -1, 1,
|
||||||
'spec/ol/reproj/expected/4326-to-3857.png', 1, done);
|
'rendering/ol/reproj/expected/4326-to-3857.png', 1, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -132,20 +132,20 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
url: 'spec/ol/data/tiles/osm-512x256/{z}/{x}/{y}.png',
|
url: 'rendering/ol/data/tiles/osm-512x256/{z}/{x}/{y}.png',
|
||||||
tileSize: [512, 256]
|
tileSize: [512, 256]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('works for identity reprojection', function(done) {
|
it('works for identity reprojection', function(done) {
|
||||||
testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 3, -13, 1,
|
testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 3, -13, 1,
|
||||||
'spec/ol/data/tiles/osm-512x256/5/3/12.png', 1, done);
|
'rendering/ol/data/tiles/osm-512x256/5/3/12.png', 1, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('to 64x128 EPSG:4326', function(done) {
|
it('to 64x128 EPSG:4326', function(done) {
|
||||||
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 128]);
|
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 128]);
|
||||||
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 27, -10, 1,
|
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 27, -10, 1,
|
||||||
'spec/ol/reproj/expected/512x256-to-64x128.png', 1, done);
|
'rendering/ol/reproj/expected/512x256-to-64x128.png', 1, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ describe('ol.rendering.reproj.Tile', function() {
|
|||||||
source = new ol.source.XYZ({
|
source = new ol.source.XYZ({
|
||||||
projection: 'EPSG:4326',
|
projection: 'EPSG:4326',
|
||||||
maxZoom: 0,
|
maxZoom: 0,
|
||||||
url: 'spec/ol/data/tiles/4326/{z}/{x}/{y}.png'
|
url: 'rendering/ol/data/tiles/4326/{z}/{x}/{y}.png'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -165,7 +165,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', 2, done);
|
'rendering/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) {
|
||||||
@@ -176,7 +176,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', 2, done);
|
'rendering/ol/reproj/expected/dateline-pole.png', 2, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@@ -43,7 +43,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
'LAYERS': 'layer'
|
'LAYERS': 'layer'
|
||||||
},
|
},
|
||||||
gutter: gutter,
|
gutter: gutter,
|
||||||
url: 'spec/ol/data/tiles/wms/wms' + gutter + '.png'
|
url: 'rendering/ol/data/tiles/wms/wms' + gutter + '.png'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('canvas', 1);
|
var map = createMap('canvas', 1);
|
||||||
var source = createSource(0);
|
var source = createSource(0);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/0_1.canvas.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/0_1.canvas.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -64,7 +64,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('webgl', 1);
|
var map = createMap('webgl', 1);
|
||||||
var source = createSource(0);
|
var source = createSource(0);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/0_1.webgl.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/0_1.webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -77,7 +77,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('canvas', 2);
|
var map = createMap('canvas', 2);
|
||||||
var source = createSource(0);
|
var source = createSource(0);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/0_2.canvas.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/0_2.canvas.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -89,7 +89,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('webgl', 2);
|
var map = createMap('webgl', 2);
|
||||||
var source = createSource(0);
|
var source = createSource(0);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/0_2.webgl.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/0_2.webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -103,7 +103,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('canvas', 1);
|
var map = createMap('canvas', 1);
|
||||||
var source = createSource(20);
|
var source = createSource(20);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/20_1.canvas.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/20_1.canvas.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -115,7 +115,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('webgl', 1);
|
var map = createMap('webgl', 1);
|
||||||
var source = createSource(20);
|
var source = createSource(20);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/20_1.webgl.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/20_1.webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -128,7 +128,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('canvas', 2);
|
var map = createMap('canvas', 2);
|
||||||
var source = createSource(20);
|
var source = createSource(20);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/20_2.canvas.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/20_2.canvas.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -140,7 +140,7 @@ describe('ol.rendering.source.TileWMS', function() {
|
|||||||
var map = createMap('webgl', 2);
|
var map = createMap('webgl', 2);
|
||||||
var source = createSource(20);
|
var source = createSource(20);
|
||||||
tilesLoaded(source, function() {
|
tilesLoaded(source, function() {
|
||||||
expectResemble(map, 'spec/ol/source/expected/20_2.webgl.png', IMAGE_TOLERANCE, done);
|
expectResemble(map, 'rendering/ol/source/expected/20_2.webgl.png', IMAGE_TOLERANCE, done);
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Tile({
|
map.addLayer(new ol.layer.Tile({
|
||||||
source: source
|
source: source
|
||||||
@@ -186,7 +186,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
it('tests the canvas renderer', function(done) {
|
it('tests the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
createFeatures();
|
createFeatures();
|
||||||
expectResemble(map, 'spec/ol/style/expected/circle-canvas.png',
|
expectResemble(map, 'rendering/ol/style/expected/circle-canvas.png',
|
||||||
8.0, done);
|
8.0, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
assertWebGL();
|
assertWebGL();
|
||||||
map = createMap('webgl');
|
map = createMap('webgl');
|
||||||
createFeatures();
|
createFeatures();
|
||||||
expectResemble(map, 'spec/ol/style/expected/circle-webgl.png',
|
expectResemble(map, 'rendering/ol/style/expected/circle-webgl.png',
|
||||||
8.0, done);
|
8.0, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |