From d13a5dfb9f6e4afeaf12a1c8a9a1e60b66f95b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 16 Jan 2015 17:12:00 +0100 Subject: [PATCH] Add wrapX option to olx.source.OSMOptions --- externs/olx.js | 11 ++++++++++- src/ol/source/osmsource.js | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 5e76abf33b..d904360674 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -4304,7 +4304,8 @@ olx.source.TileDebugOptions.prototype.tileGrid; * crossOrigin: (null|string|undefined), * maxZoom: (number|undefined), * tileLoadFunction: (ol.TileLoadFunctionType|undefined), - * url: (string|undefined)}} + * url: (string|undefined), + * wrapX: (boolean|undefined)}} * @api */ olx.source.OSMOptions; @@ -4357,6 +4358,14 @@ olx.source.OSMOptions.prototype.tileLoadFunction; olx.source.OSMOptions.prototype.url; +/** + * Whether to wrap the world horizontally. Default is `true`. + * @type {boolean|undefined} + * @api + */ +olx.source.OSMOptions.prototype.wrapX; + + /** * @typedef {{attributions: (Array.|undefined), * doc: (Document|undefined), diff --git a/src/ol/source/osmsource.js b/src/ol/source/osmsource.js index b100bbbcdf..7f992f136e 100644 --- a/src/ol/source/osmsource.js +++ b/src/ol/source/osmsource.js @@ -39,7 +39,8 @@ ol.source.OSM = function(opt_options) { opaque: true, maxZoom: goog.isDef(options.maxZoom) ? options.maxZoom : 19, tileLoadFunction: options.tileLoadFunction, - url: url + url: url, + wrapX: options.wrapX }); };