From 66369ef0b4bb4ac8946632469c04ddbefabdb6b0 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 14 Dec 2023 18:41:25 +0100 Subject: [PATCH] Version bump, add debug output --- package.json | 2 +- src/UI/InputElement/Helpers/SlopeInput.svelte | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6d9ecc03ee..df2a6a44ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mapcomplete", - "version": "0.36.4", + "version": "0.36.5", "repository": "https://github.com/pietervdvn/MapComplete", "description": "A small website to edit OSM easily", "bugs": "https://github.com/pietervdvn/MapComplete/issues", diff --git a/src/UI/InputElement/Helpers/SlopeInput.svelte b/src/UI/InputElement/Helpers/SlopeInput.svelte index 162f88ca7a..449b913959 100644 --- a/src/UI/InputElement/Helpers/SlopeInput.svelte +++ b/src/UI/InputElement/Helpers/SlopeInput.svelte @@ -39,6 +39,7 @@ function handleOrientation(event) { + console.debug("Got gyro measurement") gotMeasurement.setData(true) // IF the phone is lying flat, then: // alpha is the compass direction (but not absolute) @@ -56,7 +57,12 @@ } } - window.addEventListener("deviceorientation", handleOrientation) + console.log("Starting device orientation listener") + try { + window.addEventListener("deviceorientation", e => handleOrientation(e)) + } catch (e) { + console.log("Could not init device orientation api due to", e) + } beta.map(beta => { if (-safetyMargin < arrowDirection && arrowDirection < safetyMargin) {