going to the source to debug mobile gps
This commit is contained in:
parent
4ad5131d35
commit
7633a41185
@ -16,7 +16,7 @@
|
|||||||
<div *ngIf="position" class="text-white">
|
<div *ngIf="position" class="text-white">
|
||||||
Heading:
|
Heading:
|
||||||
<span *ngIf="position.heading == null" class="text-danger">No Heading</span>
|
<span *ngIf="position.heading == null" class="text-danger">No Heading</span>
|
||||||
<span *ngIf="!isNaN(position.heading)">{{position.heading | number : '1.0-0'}}°</span>
|
<span *ngIf="position.heading != null">{{position.heading | number : '1.0-0'}}°</span>
|
||||||
<br>
|
<br>
|
||||||
Latitude: {{position.latitude | number : '0.0-5'}}
|
Latitude: {{position.latitude | number : '0.0-5'}}
|
||||||
<br>
|
<br>
|
||||||
|
@ -114,15 +114,15 @@ export class MapComponent implements OnDestroy, OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Display location information & submit it
|
// Display location information & submit it
|
||||||
this.physicsService.info.pipe(filter(coord => !!coord)).subscribe(pos => {
|
this.physicsService.position.pipe(filter(coord => !!coord)).subscribe(pos => {
|
||||||
console.log('painting');
|
console.log('painting', pos);
|
||||||
if (!this.position) this.center({lat: pos.latitude, lng: pos.longitude});
|
if (!this.position) this.center({lat: pos.coords.latitude, lng: pos.coords.longitude});
|
||||||
if (this.positionMarker.arrow) this.map.delete(this.positionMarker.arrow);
|
if (this.positionMarker.arrow) this.map.delete(this.positionMarker.arrow);
|
||||||
if (this.positionMarker.circle) this.map.delete(this.positionMarker.circle);
|
if (this.positionMarker.circle) this.map.delete(this.positionMarker.circle);
|
||||||
this.positionMarker.arrow = this.map.newMarker({latlng: {lat: pos.latitude, lng: pos.longitude}, noSelect: true, noDelete: true, noDeleteTool: true, icon: 'arrow', rotationAngle: pos.heading, rotationOrigin: 'center'});
|
this.positionMarker.arrow = this.map.newMarker({latlng: {lat: pos.coords.latitude, lng: pos.coords.longitude}, noSelect: true, noDelete: true, noDeleteTool: true, icon: 'arrow', rotationAngle: pos.coords.heading, rotationOrigin: 'center'});
|
||||||
this.positionMarker.circle = this.map.newCircle({latlng: {lat: pos.latitude, lng: pos.longitude}, color: '#2873d8', noSelect: true, noDelete: true, noDeleteTool: true, radius: pos.accuracy, interactive: false});
|
this.positionMarker.circle = this.map.newCircle({latlng: {lat: pos.coords.latitude, lng: pos.coords.longitude}, color: '#2873d8', noSelect: true, noDelete: true, noDeleteTool: true, radius: pos.coords.accuracy, interactive: false});
|
||||||
let ignore = this.syncService.addMyLocation({latlng: {lat: pos.latitude, lng: pos.longitude}, label: this.name, noDeleteTool: true});
|
let ignore = this.syncService.addMyLocation({latlng: {lat: pos.coords.latitude, lng: pos.coords.longitude}, label: this.name, noDeleteTool: true});
|
||||||
this.position = pos;
|
this.position = pos.coords;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Request calibration if needed
|
// Request calibration if needed
|
||||||
|
Loading…
Reference in New Issue
Block a user