rename CarpoolRoute

This commit is contained in:
sbriat
2023-09-06 16:39:44 +02:00
parent 98530af14a
commit d16997a84f
18 changed files with 108 additions and 95 deletions

View File

@@ -39,16 +39,16 @@ export class GraphhopperGeorouter implements GeorouterPort {
paths: Path[],
settings: GeorouterSettings,
): Promise<Route[]> => {
this.setDefaultUrlArgs();
this.setSettings(settings);
return this.getRoutes(paths);
this._setDefaultUrlArgs();
this._setSettings(settings);
return this._getRoutes(paths);
};
private setDefaultUrlArgs = (): void => {
private _setDefaultUrlArgs = (): void => {
this.urlArgs = ['vehicle=car', 'weighting=fastest', 'points_encoded=false'];
};
private setSettings = (settings: GeorouterSettings): void => {
private _setSettings = (settings: GeorouterSettings): void => {
if (settings.detailedDuration) {
this.urlArgs.push('details=time');
}
@@ -62,7 +62,7 @@ export class GraphhopperGeorouter implements GeorouterPort {
}
};
private getRoutes = async (paths: Path[]): Promise<Route[]> => {
private _getRoutes = async (paths: Path[]): Promise<Route[]> => {
const routes = Promise.all(
paths.map(async (path) => {
const url: string = [