mirror of
https://github.com/mapillary/mapillary-js.git
synced 2026-01-25 14:07:28 +00:00
When tiles are retrieved the the hashes required for all the nodes to be worthy are calculated. The value is supplied to the node.
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import {IAPINavImS, IAPINavImIm} from "../../src/API";
|
|
import {Node, Sequence} from "../../src/Graph";
|
|
import {IPotentialEdge} from "../../src/Edge";
|
|
|
|
export class EdgeCalculatorHelper {
|
|
public createPotentialEdge(key: string = "pkey"): IPotentialEdge {
|
|
return {
|
|
distance: 0,
|
|
motionChange: 0,
|
|
verticalMotion: 0,
|
|
directionChange: 0,
|
|
verticalDirectionChange: 0,
|
|
rotation: 0,
|
|
worldMotionAzimuth: 0,
|
|
sameSequence: false,
|
|
sameMergeCc: false,
|
|
fullPano: false,
|
|
apiNavImIm: { key: key }
|
|
};
|
|
}
|
|
|
|
public createNode(fullPano = false): Node {
|
|
let key: string = "key";
|
|
|
|
let apiNavImS: IAPINavImS = { key: "skey", keys: [key] };
|
|
let sequence: Sequence = new Sequence(apiNavImS);
|
|
|
|
let apiNavImIm: IAPINavImIm = { key: key };
|
|
|
|
if (fullPano) {
|
|
apiNavImIm.gpano = {
|
|
CroppedAreaLeftPixels: 0,
|
|
CroppedAreaTopPixels: 0,
|
|
CroppedAreaImageWidthPixels: 1,
|
|
CroppedAreaImageHeightPixels: 1,
|
|
FullPanoWidthPixels: 1,
|
|
FullPanoHeightPixels: 1
|
|
}
|
|
}
|
|
|
|
let node: Node = new Node(key, 0, {lat: 0, lon: 0}, true, sequence, apiNavImIm, [0, 0, 0], []);
|
|
|
|
return node;
|
|
}
|
|
}
|
|
|
|
export default EdgeCalculatorHelper; |