diff --git a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts index 0e71d6edb8..027317b975 100644 --- a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts +++ b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts @@ -39,14 +39,8 @@ initialize (data: any, index: number, reportOfFire: ReportOfFire) { } ngOnInit(): void { - // if ('AbsoluteOrientationSensor' in window && 'ontouchstart' in window) { - // // setup real compass thing this.getOrientation(); this.useMyCurrentLocation(); - // } else { - // // skip compass - // this.skip() - // } } async getOrientation() { @@ -86,6 +80,10 @@ async getOrientation() { handler(e, self) { if (self.reportOfFire?.headingDetectionActive){ + if (!e.alpha && !e.webkitCompassHeading){ + this.skip() + } + try { let compassHeading = e.webkitCompassHeading || Math.abs(e.alpha - 360); compassHeading = Math.trunc(compassHeading)