Add rendering test for vector tile layer

This commit is contained in:
Florent gravin
2018-11-15 15:53:06 +01:00
parent 4988a50760
commit 12f6ce7a44
4 changed files with 26 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

View File

@@ -0,0 +1,26 @@
import Map from '../../../src/ol/CompositeMap.js';
import View from '../../../src/ol/View.js';
import VectorTileSource from "../../../src/ol/source/VectorTile";
import MVT from "../../../src/ol/format/MVT";
import {createXYZ} from "../../../src/ol/tilegrid";
import VectorTileLayer from "../../../src/ol/layer/VectorTile";
new Map({
layers: [
new VectorTileLayer({
source: new VectorTileSource({
format: new MVT(),
tileGrid: createXYZ(),
url: '/data/tiles/mvt/{z}-{x}-{y}.vector.pbf',
transition: 0
})
})
],
target: 'map',
view: new View({
center: [1825927.7316762917, 6143091.089223046],
zoom: 14
})
});
render({message: 'Vector tile layer renders'});

Binary file not shown.

View File

@@ -76,14 +76,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);