Add loadWrapX option and getter

This commit is contained in:
mike-000
2020-03-28 20:59:23 +00:00
committed by Andreas Hocevar
parent f6ede1a9c0
commit f6bbf414a8

View File

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