From 45ae731aa63426aba4ac96d7081db5ee0629aaf2 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Wed, 6 Dec 2017 13:39:35 +0100 Subject: [PATCH] Add test --- test/spec/ol/source/vector.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/spec/ol/source/vector.test.js b/test/spec/ol/source/vector.test.js index 13ea161baf..8b6db3027d 100644 --- a/test/spec/ol/source/vector.test.js +++ b/test/spec/ol/source/vector.test.js @@ -451,6 +451,19 @@ describe('ol.source.Vector', function() { expect(count1).to.eql(1); expect(count2).to.eql(1); }); + + it('removes extents with #removeLoadedExtent()', function(done) { + var source = new ol.source.Vector(); + source.setLoader(function(bbox, resolution, projection) { + setTimeout(function() { + expect(source.loadedExtentsRtree_.getAll()).to.have.length(1); + source.removeLoadedExtent(bbox); + expect(source.loadedExtentsRtree_.getAll()).to.have.length(0); + done(); + }, 0); + }); + source.loadFeatures([-10000, -10000, 10000, 10000], 1, ol.proj.get('EPSG:3857')); + }); }); });