From f82619d6d026bb9b516274c7db009d63b55937d3 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Wed, 24 Oct 2018 18:37:51 +0200 Subject: [PATCH] Make rendercomplete work with vector sources without loader --- src/ol/source/Vector.js | 2 +- test/spec/ol/map.test.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index 9e5991f936..f0ea2d23ce 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -889,7 +889,7 @@ class VectorSource extends Source { if (!alreadyLoaded) { this.loader_.call(this, extentToLoad, resolution, projection); loadedExtentsRtree.insert(extentToLoad, {extent: extentToLoad.slice()}); - this.loading = true; + this.loading = this.loader_ !== VOID; } } } diff --git a/test/spec/ol/map.test.js b/test/spec/ol/map.test.js index 3355b30e8b..bf3862d522 100644 --- a/test/spec/ol/map.test.js +++ b/test/spec/ol/map.test.js @@ -4,7 +4,7 @@ import Map from '../../../src/ol/Map.js'; import MapEvent from '../../../src/ol/MapEvent.js'; import Overlay from '../../../src/ol/Overlay.js'; import View from '../../../src/ol/View.js'; -import LineString from '../../../src/ol/geom/LineString.js'; +import {LineString, Point} from '../../../src/ol/geom'; import {TOUCH} from '../../../src/ol/has.js'; import {focus} from '../../../src/ol/events/condition.js'; import {defaults as defaultInteractions} from '../../../src/ol/interaction.js'; @@ -220,6 +220,13 @@ describe('ol.Map', function() { url: 'spec/ol/data/point.json', format: new GeoJSON() }) + }), + new VectorLayer({ + source: new VectorSource({ + features: [ + new Feature(new Point([0, 0])) + ] + }) }) ] });