From f6bbf414a8de864801d31c136ab8c3816c07fe7d Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Sat, 28 Mar 2020 20:59:23 +0000 Subject: [PATCH] Add loadWrapX option and getter --- src/ol/source/Vector.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index 49ac34296b..edf1c4e25d 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -146,6 +146,10 @@ export class VectorSourceEvent extends Event { * @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the * -180° and 180° meridians to work properly, this should be set to `false`. The * resulting geometry coordinates will then exceed the world bounds. + * @property {boolean} [loadWrapX=true] Call the loader with one world width either side + * of the projection extent when the world is wrapped horizontally. This allows features + * to be loaded in a single request, but may be inefficient. If `false` only the viewport + * extent is used and the loader must determine the appropriate real world requests. */ @@ -190,7 +194,13 @@ class VectorSource extends Source { * @private * @type {boolean} */ - this.overlaps_ = options.overlaps == undefined ? true : options.overlaps; + this.loadWrapX_ = options.loadWrapX === undefined ? true : options.loadWrapX; + + /** + * @private + * @type {boolean} + */ + this.overlaps_ = options.overlaps === undefined ? true : options.overlaps; /** * @private @@ -801,6 +811,14 @@ class VectorSource extends Source { } + /** + * @return {boolean} The loadWrapX option used to construct the source. + */ + getLoadWrapX() { + return this.loadWrapX_; + } + + /** * @return {boolean} The source can have overlapping geometries. */