From 431beed45fb53e80f92875d34b0d5e54b7a40aa9 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Fri, 16 Jul 2021 20:44:03 +0100 Subject: [PATCH 1/2] Handle custom loaders without success/fail Treat custom loaders without success/fail handling as if the were VOID --- src/ol/source/Vector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index eda2f79588..96440394a7 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -983,7 +983,7 @@ class VectorSource extends Source { } } this.loading = - this.loader_ === VOID ? false : this.loadingExtentsCount_ > 0; + this.loader_.length < 4 ? false : this.loadingExtentsCount_ > 0; } refresh() { From 6c862df03f4c247297af2834a4fc44194563f9a0 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Sat, 17 Jul 2021 12:48:28 +0100 Subject: [PATCH 2/2] include custom loader in rendercomplete test include a VectorSource with custom loader (no success/fail handling) in rendercomplete test --- test/browser/spec/ol/map.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/browser/spec/ol/map.test.js b/test/browser/spec/ol/map.test.js index d6c9001cbe..a2865e572d 100644 --- a/test/browser/spec/ol/map.test.js +++ b/test/browser/spec/ol/map.test.js @@ -270,6 +270,13 @@ describe('ol.Map', function () { features: [new Feature(new Point([0, 0]))], }), }), + new VectorLayer({ + source: new VectorSource({ + loader: function (extent, resolution, projection) { + this.addFeature(new Feature(new Point([0, 0]))); + }, + }), + }), ], }); });