From 260e0a3df5a21ca1b21f665a8a7542e0d27091b1 Mon Sep 17 00:00:00 2001 From: livio Date: Mon, 5 Oct 2026 01:18:28 +0200 Subject: [PATCH] Keep compass responsive in north-up mode --- Components/Pages/Home.razor | 6 +++--- LMEMappeCatastaliApp.csproj | 4 ++-- wwwroot/js/lme-map.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Components/Pages/Home.razor b/Components/Pages/Home.razor index f3ecf41..5a692c1 100644 --- a/Components/Pages/Home.razor +++ b/Components/Pages/Home.razor @@ -680,7 +680,7 @@ @@ -2862,7 +2862,7 @@ private Task ConfigureCompassSensorAsync() { var compass = Microsoft.Maui.Devices.Sensors.Compass.Default; - var shouldMonitor = ShowCompass && CompassMode == "heading" && compass.IsSupported; + var shouldMonitor = ShowCompass && compass.IsSupported; try { if (shouldMonitor && !CompassSensorSubscribed) @@ -2897,7 +2897,7 @@ object? sender, Microsoft.Maui.Devices.Sensors.CompassChangedEventArgs args) { - if (!MapReady || !ShowCompass || CompassMode != "heading") + if (!MapReady || !ShowCompass) { return; } diff --git a/LMEMappeCatastaliApp.csproj b/LMEMappeCatastaliApp.csproj index 21339fc..8aacd6e 100644 --- a/LMEMappeCatastaliApp.csproj +++ b/LMEMappeCatastaliApp.csproj @@ -29,8 +29,8 @@ it.liviomerola.lmemappecatastali.pro - 1.0.16 - 116 + 1.0.17 + 117 $(ApplicationDisplayVersion) diff --git a/wwwroot/js/lme-map.js b/wwwroot/js/lme-map.js index b5d7aa4..9ac8d1f 100644 --- a/wwwroot/js/lme-map.js +++ b/wwwroot/js/lme-map.js @@ -624,11 +624,11 @@ function setCompassHeading(heading) { function updateCompassDisplay() { const element = lmeState.compassElement; if (!element) return; - const rotation = lmeState.compassMode === "fixed" ? 0 : -lmeState.compassHeading; + const rotation = -lmeState.compassHeading; element.classList.toggle("is-fixed", lmeState.compassMode === "fixed"); element.style.setProperty("--compass-rotation", `${rotation}deg`); element.setAttribute("aria-label", lmeState.compassMode === "fixed" - ? "Bussola: nord fisso in alto" + ? `Bussola: mappa con nord fisso, orientamento ${Math.round(lmeState.compassHeading)} gradi` : `Bussola: nord, orientamento ${Math.round(lmeState.compassHeading)} gradi`); }