Additional compass angle and lat lon props on node.

Expose specific properties for computed and original
compass angles and lat lons.
This commit is contained in:
Oscar Lorentzon 2016-10-18 12:58:54 +02:00
parent 8d54200d1a
commit d70ce53ed1
2 changed files with 22 additions and 6 deletions

View File

@ -55,6 +55,14 @@ export class NewNode {
return this._fill.captured_at;
}
public get computedCA(): number {
return this._fill.cca;
}
public get computedLatLon(): ILatLon {
return this._core.cl;
}
public get focal(): number {
return this._fill.cfocal;
}
@ -136,6 +144,14 @@ export class NewNode {
return this._fill.orientation;
}
public get originalCA(): number {
return this._fill.ca;
}
public get originalLatLon(): ILatLon {
return this._core.l;
}
/**
* Get pano.
*

View File

@ -246,7 +246,7 @@ export abstract class StateBase implements IState {
return nodesSet && !(
this._currentNode.merged &&
this._previousNode.merged &&
this._withinDistance() &&
this._withinOriginalDistance() &&
this._sameConnectedComponent()
);
}
@ -357,7 +357,7 @@ export abstract class StateBase implements IState {
return current.mergeCC === previous.mergeCC;
}
private _withinDistance(): boolean {
private _withinOriginalDistance(): boolean {
let current: NewNode = this._currentNode;
let previous: NewNode = this._previousNode;
@ -367,10 +367,10 @@ export abstract class StateBase implements IState {
// 50 km/h moves 28m in 2s
let distance: number = this._spatial.distanceFromLatLon(
current.latLon.lat,
current.latLon.lon,
previous.latLon.lat,
previous.latLon.lon);
current.originalLatLon.lat,
current.originalLatLon.lon,
previous.originalLatLon.lat,
previous.originalLatLon.lon);
return distance < 25;
}