Add ol.source.Vector#isEmpty

This commit is contained in:
Tom Payne
2013-12-04 14:49:25 +01:00
parent d5e5749967
commit 66457a7aaf
2 changed files with 24 additions and 0 deletions

View File

@@ -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.
*/

View File

@@ -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() {
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() {
it('works as expected', function() {