Open hitschhiker opened 1 year ago
Hi,
The map projection is in EPSG:3857, the extent should also be is this projection.
And you can restrict user navigation by setting an extent
to the view: https://openlayers.org/en/latest/examples/extent-constrained.html
Thanks for your reply. That was only an example for the errors in the browser. I use 'epsg:2056' with this extent this '2420000, 1030000, 2900000, 1350000'
I've implemented the OL View just like in your example: https://openlayers.org/en/latest/examples/extent-constrained.html ...and I get the browser errors for GeoAdmin-Layers when I pan or zoom to the edge of the extent
See https://codesandbox.io/s/stoic-bush-ty0s0l?file=/src/index.js
restrictedExtent
is the extent in EPSG:3857 that is used to both restrict the user navigation (used in the view) and the downloaded data (used in the layer)
hope that helps
Ok now it works for me. But only when I downsize the extent for the view so that panning cannot reach the inexistent tiles: EPSG:2056 extent basemap: [ 2420000, 1030000, 2900000, 1350000 ] (official extent GeoAdmin) extent of the view: [ 2430000, 1040000, 2890000, 1340000 ] (20km smaller in one dim)
Hi,
I work with ArcGIS JS API 4 and OL3 and load GeoAdmin-layers as WMTS-layers (TileLayers) Now I want to avoid the annoying 'http 400' messages in browser when non existing tiles were queried outside Switzerland. Setting the proper layer and map-extent [ 2420000, 1030000, 2900000, 1350000 ] does not seem to help...
Here a simple example
Do you know a better solution than restricting user navigation in the map (pan/zoom)?
Thanks for any feedback! Christian