adds routing engine
This commit is contained in:
31
web/src/lib/models/valhalla.ts
Normal file
31
web/src/lib/models/valhalla.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
interface ValhallaResponse {
|
||||
trip: {
|
||||
legs: {
|
||||
shape: string[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
|
||||
class ValhallaRoute {
|
||||
type: "Feature";
|
||||
properties: {};
|
||||
geometry: {
|
||||
type: "LineString";
|
||||
coordinates: number[][];
|
||||
};
|
||||
|
||||
constructor() {
|
||||
this.type = "Feature"
|
||||
this.properties = {}
|
||||
this.geometry = {
|
||||
type: "LineString",
|
||||
coordinates: []
|
||||
}
|
||||
}
|
||||
|
||||
toString() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
}
|
||||
|
||||
export {type ValhallaResponse, ValhallaRoute}
|
||||
Reference in New Issue
Block a user