hides map controls on mobile screens if sidebar open

This commit is contained in:
2026-06-11 15:36:04 +02:00
parent 1953df262c
commit 5e10d19bbd

View File

@@ -220,6 +220,21 @@ sidebar = L.control.sidebar({
position: 'left'
}).addTo(map);
// Hides Map Controls on Mobile while Sidebar is open
sidebar.on('content', function () {
if (window.innerWidth < 769) {
document.querySelectorAll('.leaflet-top.leaflet-right').forEach(function (el) {
el.style.display = 'none';
});
}
});
sidebar.on('closing', function () {
document.querySelectorAll('.leaflet-top.leaflet-right').forEach(function (el) {
el.style.display = '';
});
});
// =====================================================================
// Block 6: Geoman Drawing Tools and CRUD Trigger