Avoid unnecessary transform in MVT format
When using ol.render.Feature there was a mandatory geometry transform. With this change it is now easy to read features directly in the native tile projection. Since there is no needed transform, there is no need either to define an extent and a world extent, for that use-case.
This commit is contained in:
@@ -65,6 +65,15 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function () {
|
||||
expect(geometry.getCoordinates()[1][0]).to.eql([4160, 3489]);
|
||||
});
|
||||
|
||||
it('avoids unnecessary reprojections of the ol.render.Feature', function () {
|
||||
const format = new MVT({
|
||||
layers: ['poi_label'],
|
||||
});
|
||||
const geometry = format.readFeatures(data)[0].getGeometry();
|
||||
expect(geometry.getType()).to.be('Point');
|
||||
expect(geometry.getFlatCoordinates()).to.eql([-1210, 2681]);
|
||||
});
|
||||
|
||||
it('parses id property', function () {
|
||||
// ol.Feature
|
||||
let format = new MVT({
|
||||
|
||||
Reference in New Issue
Block a user