fixed calibration tool
This commit is contained in:
parent
782af55fe0
commit
210584c9bb
@ -46,13 +46,13 @@ export class PhysicsService {
|
||||
};
|
||||
|
||||
if(this.mode == null) this.mode = info.heading ? 'gps' : 'orientation';
|
||||
if(this.mode == 'orientation' && data[1]) {
|
||||
if(!data[1].absolute && data[2] == Infinity) {
|
||||
if(this.mode == 'orientation') {
|
||||
if((!data[1] || !data[1].absolute) && data[2] == Infinity) {
|
||||
this.calibrate.next(0);
|
||||
this.requireCalibration.emit();
|
||||
}
|
||||
|
||||
info.heading = -data[1].alpha + (data[2] == Infinity ? 0 : data[2]);
|
||||
info.heading = -(data[1] ? data[1].alpha : 0) + (data[2] == Infinity ? 0 : data[2]);
|
||||
if(info.heading < 0) info.heading += 360;
|
||||
if(info.heading >= 360) info.heading -= 360;
|
||||
}
|
||||
|
@ -119,7 +119,8 @@ export class MapComponent implements OnDestroy, OnInit {
|
||||
if (!this.position) this.center({lat: pos.latitude, lng: pos.longitude});
|
||||
if (this.positionMarker.arrow) this.map.delete(this.positionMarker.arrow);
|
||||
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'});
|
||||
console.log(pos.heading / 2);
|
||||
this.positionMarker.arrow = this.map.newMarker({latlng: {lat: pos.latitude, lng: pos.longitude}, noSelect: true, noDelete: true, noDeleteTool: true, icon: 'arrow', rotationAngle: (pos.heading / 2), 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});
|
||||
let ignore = this.syncService.addMyLocation({latlng: {lat: pos.latitude, lng: pos.longitude}, label: this.name, noDeleteTool: true});
|
||||
this.position = pos;
|
||||
|
Loading…
Reference in New Issue
Block a user