Add an extent restriction on the mapbox layer example

This fixes a bug where the OL map would allow much larger resolution than
mapbox.
This commit is contained in:
Olivier Guyot
2019-01-30 19:13:27 +01:00
parent 78e8f23df5
commit 7835869582

View File

@@ -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
})
});