Skip to content

Commit f58ba03

Browse files
authored
Merge pull request #4642 from alexandrevryghem/restrict-map-bounds_contribute-main
Improved geospatial map bounds & scroll behaviour
2 parents 59e477a + 643836a commit f58ba03

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
@@ -153,13 +153,19 @@ export class GeospatialMapComponent implements AfterViewInit, OnInit, OnDestroy
153153
this.map = L.map(el, {
154154
center: this.DEFAULT_CENTRE_POINT,
155155
zoom: 11,
156+
worldCopyJump: true,
157+
maxBoundsViscosity: 1.0,
158+
maxBounds: [
159+
[-85, -Infinity],
160+
[85, Infinity],
161+
],
156162
});
157163
const tileProviders = environment.geospatialMapViewer.tileProviders;
158164
for (let i = 0; i < tileProviders.length; i++) {
159165
// Add tiles to the map
160166
const tiles = L.tileLayer.provider(tileProviders[i], {
161167
maxZoom: 18,
162-
minZoom: 3,
168+
minZoom: 1,
163169
});
164170
tiles.addTo(this.map);
165171
}

0 commit comments

Comments
 (0)