Merge pull request #8934 from fgravin/renderingtest
Port layer tiles rendering tests
This commit is contained in:
@@ -73,49 +73,6 @@ describe('ol.rendering.layer.Tile', function() {
|
||||
});
|
||||
}
|
||||
|
||||
describe('with tile transition', function() {
|
||||
it('renders correctly after the transition', function(done) {
|
||||
createMap('canvas');
|
||||
const source = new XYZ({
|
||||
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
|
||||
});
|
||||
waitForTiles('canvas', [source], {}, function() {
|
||||
setTimeout(function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/osm-canvas.png',
|
||||
IMAGE_TOLERANCE, done);
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('single tile layer', function() {
|
||||
let source;
|
||||
|
||||
beforeEach(function() {
|
||||
source = new XYZ({
|
||||
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png',
|
||||
transition: 0
|
||||
});
|
||||
});
|
||||
|
||||
it('tests the canvas renderer', function(done) {
|
||||
createMap('canvas');
|
||||
waitForTiles('canvas', [source], {}, function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/osm-canvas.png',
|
||||
IMAGE_TOLERANCE, done);
|
||||
});
|
||||
});
|
||||
|
||||
where('WebGL').it('tests the WebGL renderer', function(done) {
|
||||
assertWebGL();
|
||||
createMap('webgl');
|
||||
waitForTiles('webgl', [source], {}, function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/osm-webgl.png',
|
||||
IMAGE_TOLERANCE, done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('two tile layers', function() {
|
||||
let source1, source2;
|
||||
|
||||
@@ -146,14 +103,6 @@ describe('ol.rendering.layer.Tile', function() {
|
||||
return [c[0] + qw, c[1] + qh, c[2] - qw, c[3] - qh];
|
||||
}
|
||||
|
||||
it('tests canvas layer extent clipping', function(done) {
|
||||
createMap('canvas');
|
||||
waitForTiles('canvas', [source1, source2], [{}, {extent: centerExtent(map)}], function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent.png',
|
||||
IMAGE_TOLERANCE, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('tests canvas layer extent clipping with rotation', function(done) {
|
||||
createMap('canvas');
|
||||
map.getView().setRotation(Math.PI / 2);
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import MVT from '../../../../src/ol/format/MVT.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
import VectorTileLayer from '../../../../src/ol/layer/VectorTile.js';
|
||||
import {assign} from '../../../../src/ol/obj.js';
|
||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import VectorTileSource from '../../../../src/ol/source/VectorTile.js';
|
||||
import CircleStyle from '../../../../src/ol/style/Circle.js';
|
||||
import Fill from '../../../../src/ol/style/Fill.js';
|
||||
@@ -76,49 +72,6 @@ describe('ol.rendering.layer.VectorTile', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('renders correctly with the canvas renderer', function(done) {
|
||||
createMap();
|
||||
waitForTiles(source, {}, function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas.png',
|
||||
22, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('renders rotated view correctly with the canvas renderer', function(done) {
|
||||
createMap();
|
||||
map.getView().setRotation(Math.PI / 4);
|
||||
waitForTiles(source, {}, function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas-rotated.png',
|
||||
14, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('renders rotated view correctly with vector layer on top', function(done) {
|
||||
createMap();
|
||||
const vectorSource = new VectorSource({
|
||||
features: [
|
||||
new Feature(new Point([1825727.7316762917, 6143091.089223046]))
|
||||
]
|
||||
});
|
||||
map.addLayer(new VectorLayer({
|
||||
zIndex: 1,
|
||||
source: vectorSource,
|
||||
style: new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 10,
|
||||
fill: new Fill({
|
||||
color: 'red'
|
||||
})
|
||||
})
|
||||
})
|
||||
}));
|
||||
map.getView().setRotation(Math.PI / 4);
|
||||
waitForTiles(source, {}, function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/vectortile-vector-rotated.png',
|
||||
14, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('renders correctly with the canvas renderer (HiDPI)', function(done) {
|
||||
createMap(2);
|
||||
waitForTiles(source, {}, function() {
|
||||
|
||||
Reference in New Issue
Block a user