diff --git a/examples/reprojection.js b/examples/reprojection.js index 4093e6693f..dec799b8eb 100644 --- a/examples/reprojection.js +++ b/examples/reprojection.js @@ -178,6 +178,13 @@ function updateViewProjection() { extent: newProjExtent || undefined }); map.setView(newView); + + // Example how to prevent double occurence of map by limiting layer extent + if (newProj == ol.proj.get('EPSG:3857')) { + layers['bng'].setExtent([-1057216, 6405988, 404315, 8759696]); + } else { + layers['bng'].setExtent(undefined); + } }