|
|
@ -74,7 +74,6 @@
|
|
|
|
zoomSnap: 0.5,
|
|
|
|
zoomSnap: 0.5,
|
|
|
|
animate: true,
|
|
|
|
animate: true,
|
|
|
|
maxZoom: 19,
|
|
|
|
maxZoom: 19,
|
|
|
|
minZoom: 10
|
|
|
|
|
|
|
|
//dragging: false,
|
|
|
|
//dragging: false,
|
|
|
|
//scrollWheelZoom: false,
|
|
|
|
//scrollWheelZoom: false,
|
|
|
|
}).setView([48.505, 1.09], zoom_level);
|
|
|
|
}).setView([48.505, 1.09], zoom_level);
|
|
|
@ -355,6 +354,7 @@
|
|
|
|
DeviceOrientationEvent.requestPermission()
|
|
|
|
DeviceOrientationEvent.requestPermission()
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
if (response === "granted") {
|
|
|
|
if (response === "granted") {
|
|
|
|
|
|
|
|
alert("granted")
|
|
|
|
window.addEventListener("deviceorientation", handler, true);
|
|
|
|
window.addEventListener("deviceorientation", handler, true);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
alert("has to be allowed!");
|
|
|
|
alert("has to be allowed!");
|
|
|
@ -366,7 +366,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
function handler(e) {
|
|
|
|
function handler(e) {
|
|
|
|
compass = e.webkitCompassHeading || Math.abs(e.alpha - 360);
|
|
|
|
compass = e.webkitCompassHeading || Math.abs(e.alpha - 360);
|
|
|
|
compassCircle.style.transform = `translate(-50%, -50%) rotate(${pointDegree-compass}deg)`;
|
|
|
|
compassCircle.style.transform = `translate(-50%, -50%) rotate(${-compass}deg)`;
|
|
|
|
|
|
|
|
|
|
|
|
// ±15 degree
|
|
|
|
// ±15 degree
|
|
|
|
|
|
|
|
|
|
|
|