Skip to content

Commit

Permalink
set snap_preventions only if configured
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Nov 3, 2024
1 parent 12c08e2 commit 286caee
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const config = {
'track_type',
'country',
],
snapPreventions: ['ferry'],
},

// Use 'profiles' to define which profiles are visible and how. Useful if the /info endpoint contains too many or too "ugly" profile
Expand Down
3 changes: 2 additions & 1 deletion src/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,12 @@ export class ApiImpl implements Api {
locale: getTranslation().getLang(),
points_encoded: true,
points_encoded_multiplier: 1e6,
snap_preventions: config.request?.snapPreventions ? config.request.snapPreventions : [],
...profileConfig,
details: details,
}

if (config.request?.snapPreventions) request.snap_preventions = config.request?.snapPreventions

if (args.customModel) {
request.custom_model = args.customModel
request['ch.disable'] = true
Expand Down
4 changes: 0 additions & 4 deletions test/routing/Api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ describe('route', () => {
locale: 'en_US',
points_encoded: true,
points_encoded_multiplier: 1e6,
snap_preventions: ['ferry'],
details: [
'road_class',
'road_environment',
Expand Down Expand Up @@ -155,7 +154,6 @@ describe('route', () => {
locale: 'en_US',
points_encoded: true,
points_encoded_multiplier: 1e6,
snap_preventions: ['ferry'],
details: [
'road_class',
'road_environment',
Expand Down Expand Up @@ -207,7 +205,6 @@ describe('route', () => {
locale: 'en_US',
points_encoded: true,
points_encoded_multiplier: 1e6,
snap_preventions: ['ferry'],
details: [
'road_class',
'road_environment',
Expand Down Expand Up @@ -315,7 +312,6 @@ describe('route', () => {
locale: 'de_DE',
points_encoded: true,
points_encoded_multiplier: 1e6,
snap_preventions: ['ferry'],
details: [
'road_class',
'road_environment',
Expand Down

0 comments on commit 286caee

Please sign in to comment.