From a60a7f7c09c517e963639eaaaae767d2a8b371d2 Mon Sep 17 00:00:00 2001 From: FRizZL Date: Tue, 27 Oct 2015 00:21:10 +0100 Subject: [PATCH] Add wrapX override support for ol.source.Cluster It was not possible to override the wrapX option for the cluster source. This commit adds that functionality. --- externs/olx.js | 19 ++++++++++++++----- src/ol/source/clustersource.js | 3 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index f6cf740ff8..eef86f69d0 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -3684,7 +3684,8 @@ olx.source.BingMapsOptions.prototype.wrapX; * format: (ol.format.Feature|undefined), * logo: (string|undefined), * projection: ol.proj.ProjectionLike, - * source: ol.source.Vector}} + * source: ol.source.Vector, + * wrapX: (boolean|undefined)}} * @api */ olx.source.ClusterOptions; @@ -3746,6 +3747,14 @@ olx.source.ClusterOptions.prototype.projection; olx.source.ClusterOptions.prototype.source; +/** + * WrapX. Default is true + * @type {boolean|undefined} + * @api + */ +olx.source.ClusterOptions.prototype.wrapX; + + /** * @typedef {{preemptive: (boolean|undefined), * url: string}} @@ -5165,10 +5174,10 @@ olx.source.VectorOptions.prototype.strategy; * other loading strategies. * Requires `format` to be set as well. * When default XHR feature loader is provided, the features will - * be transformed from the data projection to the view projection - * during parsing. If your remote data source does not advertise its projection - * properly, this transformation will be incorrect. For some formats, the - * default projection (usually EPSG:4326) can be overridden by setting the + * be transformed from the data projection to the view projection + * during parsing. If your remote data source does not advertise its projection + * properly, this transformation will be incorrect. For some formats, the + * default projection (usually EPSG:4326) can be overridden by setting the * defaultDataProjection constructor option on the format. * @type {string|ol.FeatureUrlFunction|undefined} * @api diff --git a/src/ol/source/clustersource.js b/src/ol/source/clustersource.js index b05a791f76..4cf2ca0c6c 100644 --- a/src/ol/source/clustersource.js +++ b/src/ol/source/clustersource.js @@ -28,7 +28,8 @@ ol.source.Cluster = function(options) { attributions: options.attributions, extent: options.extent, logo: options.logo, - projection: options.projection + projection: options.projection, + wrapX: options.wrapX }); /**