Fix several issues, attemt to fix zooming issue
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma
2020-02-21 00:11:18 +01:00
parent abfef73cd1
commit 3a38c24360
5 changed files with 68 additions and 58 deletions

View File

@@ -40,7 +40,10 @@ export class DeviceOrientationService {
getCurrentCompassHeading(): Observable<number> {
return Observable.create((observer: Observer<number>) => {
window.addEventListener("deviceorientation", (event:DeviceOrientationEvent)=>{
observer.next(this.compassHeading(event.alpha,event.beta,event.gamma));
let heading = this.compassHeading(event.alpha,event.beta,event.gamma);
if(!Number.isNaN(heading)) {
observer.next(heading);
}
} );
});
}