Fix typo, add test
This commit is contained in:
@@ -653,7 +653,7 @@ class VectorSource extends Source {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all snapshot of the features currently on the source in random order. The returned array
|
* Get a snapshot of the features currently on the source in random order. The returned array
|
||||||
* is a copy, the features are references to the features in the source.
|
* is a copy, the features are references to the features in the source.
|
||||||
* @return {Array<import("../Feature.js").default<Geometry>>} Features.
|
* @return {Array<import("../Feature.js").default<Geometry>>} Features.
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -143,6 +143,18 @@ describe('ol.source.Vector', function () {
|
|||||||
expect(feature).to.be(features[0]);
|
expect(feature).to.be(features[0]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('#getFeatures', function () {
|
||||||
|
it('does not return the internal array when useSpatialIndex is false', function () {
|
||||||
|
const noSpatialIndexSource = new VectorSource({
|
||||||
|
useSpatialIndex: false,
|
||||||
|
features: vectorSource.getFeatures(),
|
||||||
|
});
|
||||||
|
expect(noSpatialIndexSource.getFeatures()).to.not.be(
|
||||||
|
noSpatialIndexSource.getFeaturesCollection().getArray()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('clear and refresh', function () {
|
describe('clear and refresh', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user