From 7835869582f290513cb27db6a8005f0d87acae50 Mon Sep 17 00:00:00 2001 From: Olivier Guyot Date: Wed, 30 Jan 2019 19:13:27 +0100 Subject: [PATCH] Add an extent restriction on the mapbox layer example This fixes a bug where the OL map would allow much larger resolution than mapbox. --- examples/mapbox-layer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/mapbox-layer.js b/examples/mapbox-layer.js index aa2fbadcf4..e717328572 100644 --- a/examples/mapbox-layer.js +++ b/examples/mapbox-layer.js @@ -203,7 +203,11 @@ const map = new Map({ target: 'map', view: new View({ center: [-10997148, 4569099], - zoom: 4 + zoom: 4, + minZoom: 1, + extent: [-Infinity, -20048966.10, Infinity, 20048966.10], + smoothExtentConstraint: false, + smoothResolutionConstraint: false }) });