Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgilbers committed Aug 27, 2024
1 parent a269668 commit ac27cdb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const map = L.map('map', {
rotate: true,
rotateControl: {
closeOnZeroBearing: true,
position: 'bottomleft',
position: 'bottomleft'
},
bearing: 0,
touchRotate: true
Expand Down Expand Up @@ -426,14 +426,14 @@ html5QrcodeScanner.render(onScanSuccess, onScanFailure)
// Request permission for iOS 13+ devices
if (
DeviceMotionEvent &&
typeof DeviceMotionEvent.requestPermission === "function"
typeof DeviceMotionEvent.requestPermission === 'function'
) {
DeviceMotionEvent.requestPermission();
DeviceMotionEvent.requestPermission()
}

window.addEventListener("deviceorientation", handleOrientation);
window.addEventListener('deviceorientation', handleOrientation)

function handleOrientation(event) {
let orientation = -event.webkitCompassHeading.toFixed(10)
function handleOrientation (event) {
const orientation = 360 - event.webkitCompassHeading.toFixed(10)
map.setBearing(orientation)
}
}

0 comments on commit ac27cdb

Please sign in to comment.