mirror of
https://github.com/mapillary/mapillary-js.git
synced 2026-01-25 14:07:28 +00:00
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:
parent
8d54200d1a
commit
d70ce53ed1
@ -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.
|
||||
*
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user