From 643836addc76ecd04584e1af661ccd0f96465edc Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Mon, 18 Aug 2025 18:37:48 +0200 Subject: [PATCH] Restricted map bounds --- src/app/shared/geospatial-map/geospatial-map.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/shared/geospatial-map/geospatial-map.component.ts b/src/app/shared/geospatial-map/geospatial-map.component.ts index 8f9cc76355..6da07258f6 100644 --- a/src/app/shared/geospatial-map/geospatial-map.component.ts +++ b/src/app/shared/geospatial-map/geospatial-map.component.ts @@ -150,13 +150,19 @@ export class GeospatialMapComponent implements AfterViewInit, OnInit, OnDestroy this.map = L.map(el, { center: this.DEFAULT_CENTRE_POINT, zoom: 11, + worldCopyJump: true, + maxBoundsViscosity: 1.0, + maxBounds: [ + [-85, -Infinity], + [85, Infinity], + ], }); const tileProviders = environment.geospatialMapViewer.tileProviders; for (let i = 0; i < tileProviders.length; i++) { // Add tiles to the map const tiles = L.tileLayer.provider(tileProviders[i], { maxZoom: 18, - minZoom: 3, + minZoom: 1, }); tiles.addTo(this.map); }