From fafcb65fff39d69860e0e08988c0f5c18d996a2f Mon Sep 17 00:00:00 2001 From: jeanpierre Date: Thu, 9 Dec 2021 18:43:56 +0100 Subject: [PATCH] update line-arrows example as same behavior as #13074 Co-Authored-By: Andreas Hocevar <211514+ahocevar@users.noreply.github.com> --- examples/line-arrows.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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, }), });