Skip to content

Commit

Permalink
Remove fastest weighting option
Browse files Browse the repository at this point in the history
default is now recommended which is fastest for car

closes #315
  • Loading branch information
TheGreatRefrigerator committed Aug 10, 2020
1 parent 100c4ec commit 230b380
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Changed
- leaflet.heightgraph version & style
- default weigthing option to recommended ([#315](https://github.com/GIScience/openrouteservice-app/issues/315))

### Removed
- fastest weighting option ([#315](https://github.com/GIScience/openrouteservice-app/issues/315))

## [v0.5.4] - 2020-07-23

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,16 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
ctrl.currentOptions.weight =
ctrl.currentOptions.weight !== undefined
? ctrl.currentOptions.weight
: ctrl.optionList.weight.Fastest.value;
: ctrl.optionList.weight.Recommended.value;
ctrl.weightSlider = {
value: ctrl.currentOptions.weight,
options: {
stepsArray: [
{
value: ctrl.optionList.weight.Fastest.value
value: ctrl.optionList.weight.Recommended.value
},
{
value: ctrl.optionList.weight.Shortest.value
},
{
value: ctrl.optionList.weight.Recommended.value
}
],
showTicks: true,
Expand Down
8 changes: 2 additions & 6 deletions app/constants/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,13 @@ angular.module("orsApp").constant("lists", {
},
optionList: {
weight: {
Fastest: {
value: "Fastest",
Recommended: {
value: "Recommended",
shortValue: "0"
},
Shortest: {
value: "Shortest",
shortValue: "1"
},
Recommended: {
value: "Recommended",
shortValue: "2"
}
},
roundTrip: {
Expand Down
4 changes: 4 additions & 0 deletions app/infrastructure/ors-params-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ angular.module("orsApp.params-service", []).factory("orsParamsService", [
}
}
if (key === "weight") {
// switches to Recommended (0) for old Recommended values (2), old Fastest (0) go automatically to Recommended
if (value === "2") {
value = "0"
}
for (let weightType in lists.optionList.weight) {
if (lists.optionList.weight[weightType].shortValue === value) {
settings.profile.options.weight =
Expand Down
2 changes: 1 addition & 1 deletion app/languages/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"CHOOSELANG": "Wählen Sie eine Sprache",
"LANGROUTING": "Sprache der Routing-Anweisungen",
"Fastest": "Schnellste",
"Recommended": "Bevorzugt",
"Recommended": "Empfohlen",
"Shortest": "Kürzeste",
"BICYCLENORMAL": "Normal",
"BICYCLESAFEST": "Sichere Route",
Expand Down

0 comments on commit 230b380

Please sign in to comment.