Report ol.VectorTile instead of ol.VectorImageTile loads

This commit is contained in:
Andreas Hocevar
2017-05-16 23:58:42 +02:00
parent 9af01c515f
commit 8c00bbc91d
4 changed files with 38 additions and 12 deletions

View File

@@ -13,7 +13,8 @@ describe('ol.source.VectorTile', function() {
var source = new ol.source.VectorTile({
format: format,
tileGrid: ol.tilegrid.createXYZ({tileSize: 512}),
url: '{z}/{x}/{y}.pbf'
tilePixelRatio: 8,
url: 'spec/ol/data/{z}-{x}-{y}.vector.pbf'
});
var tile;
@@ -47,4 +48,21 @@ describe('ol.source.VectorTile', function() {
});
});
describe('Tile load events', function() {
it('triggers tileloadstart and tileloadend with ol.VectorTile', function(done) {
tile = source.getTile(14, 8938, -5681, 1, ol.proj.get('EPSG:3857'));
var started = false;
source.on('tileloadstart', function() {
started = true;
});
source.on('tileloadend', function(e) {
expect(started).to.be(true);
expect(e.tile).to.be.a(ol.VectorTile);
expect(e.tile.getFeatures().length).to.be(1327);
done();
});
tile.load();
});
});
});