Replaces vectorimage.tests.js (partially)
Transforms the old rendering tests for the VectorImageLayer to the new rendering test approach. The declutter tests are kept in the old format for know.
This commit is contained in:
@@ -53,91 +53,6 @@ describe('ol.rendering.layer.VectorImage', function() {
|
||||
])));
|
||||
}
|
||||
|
||||
it('renders opacity correctly', function(done) {
|
||||
createMap();
|
||||
const smallLine = new Feature(new LineString([
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
smallLine.setStyle(new Style({
|
||||
zIndex: -99,
|
||||
stroke: new Stroke({width: 75, color: 'red'})
|
||||
}));
|
||||
source.addFeature(smallLine);
|
||||
addPolygon(100);
|
||||
addCircle(200);
|
||||
addPolygon(250);
|
||||
addCircle(500);
|
||||
addPolygon(600);
|
||||
addPolygon(720);
|
||||
map.addLayer(new VectorImageLayer({
|
||||
source: source
|
||||
}));
|
||||
map.once('postrender', function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas.png',
|
||||
17, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('renders transparent layers correctly', function(done) {
|
||||
createMap();
|
||||
const smallLine = new Feature(new LineString([
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
smallLine.setStyle([
|
||||
new Style({
|
||||
stroke: new Stroke({width: 75, color: 'red'})
|
||||
}),
|
||||
new Style({
|
||||
stroke: new Stroke({width: 45, color: 'white'})
|
||||
})
|
||||
]);
|
||||
source.addFeature(smallLine);
|
||||
const smallLine2 = new Feature(new LineString([
|
||||
[center[0], center[1] - 1000],
|
||||
[center[0], center[1] + 1000]
|
||||
]));
|
||||
smallLine2.setStyle([
|
||||
new Style({
|
||||
stroke: new Stroke({width: 35, color: 'blue'})
|
||||
}),
|
||||
new Style({
|
||||
stroke: new Stroke({width: 15, color: 'green'})
|
||||
})
|
||||
]);
|
||||
source.addFeature(smallLine2);
|
||||
|
||||
map.addLayer(new VectorImageLayer({
|
||||
source: source,
|
||||
opacity: 0.5
|
||||
}));
|
||||
map.once('postrender', function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-transparent.png',
|
||||
7, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('renders rotation correctly', function(done) {
|
||||
createMap();
|
||||
map.getView().setRotation(Math.PI + Math.PI / 4);
|
||||
addPolygon(300);
|
||||
addCircle(500);
|
||||
map.addLayer(new VectorImageLayer({
|
||||
source: source,
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
width: 2,
|
||||
color: 'black'
|
||||
})
|
||||
})
|
||||
}));
|
||||
map.once('postrender', function() {
|
||||
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-rotated.png',
|
||||
2.9, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('unskips features correctly', function(done) {
|
||||
createMap();
|
||||
addCircle(500);
|
||||
|
||||
Reference in New Issue
Block a user