Add ol.source.Vector#isEmpty
This commit is contained in:
@@ -166,6 +166,14 @@ ol.source.Vector.prototype.handleFeatureChange_ = function(event) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {boolean} Is empty.
|
||||||
|
*/
|
||||||
|
ol.source.Vector.prototype.isEmpty = function() {
|
||||||
|
return this.rBush_.isEmpty();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -37,6 +37,14 @@ describe('ol.source.Vector', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('#isEmpty', function() {
|
||||||
|
|
||||||
|
it('returns true', function() {
|
||||||
|
expect(vectorSource.isEmpty()).to.be(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
describe('#addFeature', function() {
|
describe('#addFeature', function() {
|
||||||
|
|
||||||
it('can add a single point feature', function() {
|
it('can add a single point feature', function() {
|
||||||
@@ -103,6 +111,14 @@ describe('ol.source.Vector', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('#isEmpty', function() {
|
||||||
|
|
||||||
|
it('returns false', function() {
|
||||||
|
expect(vectorSource.isEmpty()).to.be(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
describe.skip('#removeFeature', function() {
|
describe.skip('#removeFeature', function() {
|
||||||
|
|
||||||
it('works as expected', function() {
|
it('works as expected', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user