Constrain WebSDR map to prevent vertical black space

Add maxBounds to limit vertical panning to ±85° latitude and set
minZoom to 2 so tiles always cover the visible area. Prevents the
large black bands above and below the map tiles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-07 14:30:23 +00:00
parent 3b191dccd6
commit bfd92e3883

View File

@@ -41,13 +41,17 @@ function initWebSDR() {
websdrMap = L.map('websdrMap', {
center: [30, 0],
zoom: 2,
minZoom: 2,
zoomControl: true,
maxBounds: [[-85, -Infinity], [85, Infinity]],
maxBoundsViscosity: 1.0,
});
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
attribution: '&copy; OpenStreetMap contributors &copy; CARTO',
subdomains: 'abcd',
maxZoom: 19,
noWrap: false,
}).addTo(websdrMap);
websdrInitialized = true;