@@ -32,8 +32,8 @@
No GPS
Heading:
- No Heading
- {{position.heading | number : '0.0-0'}}°
+ No Heading
+ {{position.heading | number : '1.0-0'}}°
Latitude: {{position.latitude | number : '0.0-5'}}
diff --git a/src/app/map/map.component.ts b/src/app/map/map.component.ts
index 62de25c..64ed801 100644
--- a/src/app/map/map.component.ts
+++ b/src/app/map/map.component.ts
@@ -24,12 +24,12 @@ export class MapComponent {
style: 'satellite' | 'terrain' | 'roadmap' | 'hybrid' = 'terrain';
version = version;
+ Infinity = Infinity;
isNaN = isNaN;
constructor(private bpObserver: BreakpointObserver, public physicsService: PhysicsService, private snackBar: MatSnackBar, private bottomSheet: MatBottomSheet) {
bpObserver.observe([Breakpoints.Handset]).subscribe(results => this.mobile = results.matches);
- physicsService.info.pipe(filter(coord => !!coord), debounceTime(50)).subscribe(pos => {
- console.log('fire');
+ physicsService.info.pipe(filter(coord => !!coord)).subscribe(pos => {
if(this.mapApi) {
if(!this.position) this.center(pos);
this.position = pos;
diff --git a/src/app/physics/physics.service.ts b/src/app/physics/physics.service.ts
index f4f637c..f34ddfa 100644
--- a/src/app/physics/physics.service.ts
+++ b/src/app/physics/physics.service.ts
@@ -40,8 +40,11 @@ export class PhysicsService {
this.motionTimestamp = currentTime;
});
+ this.orientation.subscribe(() => console.log('orientation'));
+
// Combine data into one nice package
combineLatest(this.position, this.orientation, this.calibrate, this.speed).subscribe(data => {
+ console.log('combine');
if(!data[0]) return;
let info = {
@@ -54,7 +57,6 @@ export class PhysicsService {
speed: data[0].coords.speed
};
- // TODO-debug
if(info.heading == null && data[1]) {
if(!data[1].absolute && data[2] == Infinity) {
this.calibrate.next(0);