Get tilePixelRatio from MVT tiles
This commit is contained in:
@@ -88,6 +88,13 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
|
||||
expect(features[0].getId()).to.be(2);
|
||||
});
|
||||
|
||||
it('sets the extent of the last readFeatures call', function() {
|
||||
var format = new ol.format.MVT();
|
||||
format.readFeatures(data);
|
||||
var extent = format.getLastExtent();
|
||||
expect(extent.getWidth()).to.be(4096);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -186,6 +186,14 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
||||
spy2.restore();
|
||||
});
|
||||
|
||||
it('uses the extent of the source tile', function() {
|
||||
var renderer = map.getRenderer().getLayerRenderer(layer);
|
||||
var tile = new ol.VectorTile([0, 0, 0], 2);
|
||||
tile.setExtent([0, 0, 4096, 4096]);
|
||||
var tilePixelRatio = renderer.getTilePixelRatio_(source, tile);
|
||||
expect(tilePixelRatio).to.be(16);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#prepareFrame', function() {
|
||||
|
||||
Reference in New Issue
Block a user