diff --git a/examples/line-arrows.js b/examples/line-arrows.js index 5d583ca97c..d9bbf48665 100644 --- a/examples/line-arrows.js +++ b/examples/line-arrows.js @@ -5,6 +5,7 @@ import View from '../src/ol/View.js'; import {Icon, Stroke, Style} from '../src/ol/style.js'; import {OSM, Vector as VectorSource} from '../src/ol/source.js'; import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js'; +import {get} from '../src/ol/proj.js'; const raster = new TileLayer({ source: new OSM(), @@ -49,12 +50,19 @@ const vector = new VectorLayer({ style: styleFunction, }); +// Limit multi-world panning to one world east and west of the real world. +// Geometry coordinates have to be within that range. +const extent = get('EPSG:3857').getExtent().slice(); +extent[0] += extent[0]; +extent[2] += extent[2]; + const map = new Map({ layers: [raster, vector], target: 'map', view: new View({ center: [-11000000, 4600000], zoom: 4, + extent, }), });