diff --git a/examples/draw-features.js b/examples/draw-features.js index 1a25d6874e..dcab9c70db 100644 --- a/examples/draw-features.js +++ b/examples/draw-features.js @@ -14,7 +14,7 @@ var raster = new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'sat'}) }); -var source = new ol.source.Vector(); +var source = new ol.source.Vector({wrapX: false}); var vector = new ol.layer.Vector({ source: source, diff --git a/examples/modify-features.js b/examples/modify-features.js index 90709d6a8b..25c6ee18dc 100644 --- a/examples/modify-features.js +++ b/examples/modify-features.js @@ -19,7 +19,8 @@ var raster = new ol.layer.Tile({ var vector = new ol.layer.Vector({ source: new ol.source.Vector({ url: 'data/geojson/countries.geojson', - format: new ol.format.GeoJSON() + format: new ol.format.GeoJSON(), + wrapX: false }) }); diff --git a/externs/olx.js b/externs/olx.js index 674b03b8ee..0856844d8f 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -4877,7 +4877,8 @@ olx.source.TileWMSOptions.prototype.wrapX; * loader: (ol.FeatureLoader|undefined), * logo: (string|olx.LogoOptions|undefined), * strategy: (ol.LoadingStrategy|undefined), - * url: (string|undefined)}} + * url: (string|undefined), + * wrapX: (boolean|undefined)}} * @api */ olx.source.VectorOptions; @@ -4946,6 +4947,16 @@ olx.source.VectorOptions.prototype.strategy; olx.source.VectorOptions.prototype.url; +/** + * Wrap the world horizontally. Default is `true`. For vector editing across the + * 0° and 180° meridians to work properly, this should be set to `false`. The + * resulting geometry coordinates will then exceed the world bounds. + * @type {boolean|undefined} + * @api + */ +olx.source.VectorOptions.prototype.wrapX; + + /** * @typedef {{attributions: (Array.|undefined), * crossOrigin: (string|null|undefined),