Add rendering tests
This commit is contained in:
BIN
test_rendering/spec/ol/expected/render-polygon-linedash.png
Normal file
BIN
test_rendering/spec/ol/expected/render-polygon-linedash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 396 B |
Binary file not shown.
|
After Width: | Height: | Size: 403 B |
@@ -135,6 +135,49 @@ describe('ol.render', function() {
|
||||
|
||||
});
|
||||
|
||||
it('supports lineDash styles', function(done) {
|
||||
var vectorContext = ol.render.toContext(context, {size: [100, 100]});
|
||||
|
||||
var style = new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
lineDash: [10, 5]
|
||||
})
|
||||
});
|
||||
|
||||
vectorContext.setStyle(style);
|
||||
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon([
|
||||
[[25, 25], [75, 25], [75, 75], [25, 75], [25, 25]],
|
||||
[[40, 40], [40, 60], [60, 60], [60, 40], [40, 40]]
|
||||
]));
|
||||
|
||||
resembleCanvas(context.canvas,
|
||||
'spec/ol/expected/render-polygon-linedash.png', IMAGE_TOLERANCE, done);
|
||||
|
||||
});
|
||||
|
||||
it('supports lineDashOffset', function(done) {
|
||||
var vectorContext = ol.render.toContext(context, {size: [100, 100]});
|
||||
|
||||
var style = new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
lineDash: [10, 5],
|
||||
lineDashOffset: 5
|
||||
})
|
||||
});
|
||||
|
||||
vectorContext.setStyle(style);
|
||||
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon([
|
||||
[[25, 25], [75, 25], [75, 75], [25, 75], [25, 25]],
|
||||
[[40, 40], [40, 60], [60, 60], [60, 40], [40, 40]]
|
||||
]));
|
||||
|
||||
resembleCanvas(context.canvas,
|
||||
'spec/ol/expected/render-polygon-linedashoffset.png', IMAGE_TOLERANCE, done);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 819 B |
Binary file not shown.
|
After Width: | Height: | Size: 831 B |
@@ -119,6 +119,23 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
expectResemble(map, 'spec/ol/style/expected/regularshape-canvas.png', 9.4, done);
|
||||
});
|
||||
|
||||
it('supports lineDash', function(done) {
|
||||
map = createMap('canvas');
|
||||
createFeatures(new ol.style.Stroke({
|
||||
lineDash: [10, 5]
|
||||
}));
|
||||
expectResemble(map, 'spec/ol/style/expected/regularshape-canvas-linedash.png', 5, done);
|
||||
});
|
||||
|
||||
it('supports lineDashOffset', function(done) {
|
||||
map = createMap('canvas');
|
||||
createFeatures(new ol.style.Stroke({
|
||||
lineDash: [10, 5],
|
||||
lineDashOffset: 5
|
||||
}));
|
||||
expectResemble(map, 'spec/ol/style/expected/regularshape-canvas-linedashoffset.png', 5, done);
|
||||
});
|
||||
|
||||
it('tests the WebGL renderer', function(done) {
|
||||
assertWebGL();
|
||||
map = createMap('webgl');
|
||||
|
||||
Reference in New Issue
Block a user