Skip to content

Commit 643836a

Browse files
Restricted map bounds
1 parent bcc437d commit 643836a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/shared/geospatial-map/geospatial-map.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,19 @@ export class GeospatialMapComponent implements AfterViewInit, OnInit, OnDestroy
150150
this.map = L.map(el, {
151151
center: this.DEFAULT_CENTRE_POINT,
152152
zoom: 11,
153+
worldCopyJump: true,
154+
maxBoundsViscosity: 1.0,
155+
maxBounds: [
156+
[-85, -Infinity],
157+
[85, Infinity],
158+
],
153159
});
154160
const tileProviders = environment.geospatialMapViewer.tileProviders;
155161
for (let i = 0; i < tileProviders.length; i++) {
156162
// Add tiles to the map
157163
const tiles = L.tileLayer.provider(tileProviders[i], {
158164
maxZoom: 18,
159-
minZoom: 3,
165+
minZoom: 1,
160166
});
161167
tiles.addTo(this.map);
162168
}

0 commit comments

Comments
 (0)