Skip to content

Commit

Permalink
Ads minimum wheelchair width setting, closes #268
Browse files Browse the repository at this point in the history
  • Loading branch information
TimMcCauley committed Dec 13, 2018
1 parent 0f78740 commit 76bdfb7
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]

### Added
- Adds population attribution to info modal (issue #266)
- Adds road access restrictions to panel and map (issue #267)
- Adds population attribution to info modal ([#266](https://github.com/GIScience/openrouteservice-app/issues/266))
- Adds road access restrictions to panel and map ([#267](https://github.com/GIScience/openrouteservice-app/issues/267))
- Adds road access restrictions to panel and map ([#268](https://github.com/GIScience/openrouteservice-app/issues/268))
### Fixed
### Changed
### Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,16 @@
</div>
<rzslider rz-slider-model="$ctrl.wheelchairSliders.Curb.value" rz-slider-options="$ctrl.wheelchairSliders.Curb.options">
</rzslider>
<div class="ui label tiny flleft">
<span ng-bind-html="('WHEELCHAIR_WIDTH' | translate)">
</span>
<span ng-bind-html="':'">
</span>
<div class="detail" ng-bind="$ctrl.optionList.wheelchair.Width[$ctrl.wheelchairSliders.Width.value].name">
</div>
</div>
<rzslider rz-slider-model="$ctrl.wheelchairSliders.Width.value" rz-slider-options="$ctrl.wheelchairSliders.Width.options">
</rzslider>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,20 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
ctrl.currentOptions.surface !== undefined
? ctrl.optionList.wheelchair.Surface[ctrl.currentOptions.surface]
.value
: ctrl.optionList.wheelchair.Surface["concrete"].value;
: ctrl.optionList.wheelchair.Surface["any"].value;
ctrl.currentOptions.incline =
ctrl.currentOptions.incline !== undefined
? ctrl.optionList.wheelchair.Incline[ctrl.currentOptions.incline]
.value
: ctrl.optionList.wheelchair.Incline["3"].value;
: ctrl.optionList.wheelchair.Incline["31"].value;
ctrl.currentOptions.curb =
ctrl.currentOptions.curb !== undefined
? ctrl.optionList.wheelchair.Curb[ctrl.currentOptions.curb].value
: ctrl.optionList.wheelchair.Curb["0.03"].value;
: ctrl.optionList.wheelchair.Curb["0.31"].value;
ctrl.currentOptions.wheelchairWidth =
ctrl.currentOptions.wheelchairWidth !== undefined
? ctrl.optionList.wheelchair.Width[ctrl.currentOptions.wheelchairWidth].value
: ctrl.optionList.wheelchair.Width["-1"].value;
ctrl.wheelchairSliders = {
Surface: {
value: ctrl.currentOptions.surface,
Expand Down Expand Up @@ -495,6 +499,33 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
ctrl.changeOptions();
}
}
},
Width: {
value: ctrl.currentOptions.wheelchairWidth,
options: {
stepsArray: [
{
value: ctrl.optionList.wheelchair.Width["1"].value
},
{
value: ctrl.optionList.wheelchair.Width["1.5"].value
},
{
value: ctrl.optionList.wheelchair.Width["2"].value
},
{
value: ctrl.optionList.wheelchair.Width["-1"].value
}
],
showTicks: true,
showTicksValues: false,
hidePointerLabels: true,
hideLimitLabels: true,
onEnd: () => {
ctrl.currentOptions.wheelchairWidth = ctrl.wheelchairSliders.Width.value;
ctrl.changeOptions();
}
}
}
};
if (ctrl.currentOptions.borders.country !== undefined) {
Expand Down Expand Up @@ -549,6 +580,7 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
ctrl.routing = route == "directions" ? true : false;
});
ctrl.changeOptions = () => {
console.log(true)
// call setoptions
if (ctrl.currentOptions.difficulty)
ctrl.difficultySliders.Fitness.options.disabled =
Expand Down
21 changes: 20 additions & 1 deletion app/constants/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,24 @@ angular.module("orsApp").constant("lists", {
name: "Flexible",
value: 0.31
}
},
Width: {
"2": {
name: "2m",
value: 2.0
},
"1.5": {
name: "1.5m",
value: 1.5
},
"1": {
name: "1m",
value: 1.0
},
"-1": {
name: "Any width (no value set)",
value: -1
}
}
},
hgvParams: {
Expand Down Expand Up @@ -721,7 +739,7 @@ angular.module("orsApp").constant("lists", {
"steepness",
"green"
],
Wheelchair: ["type", "weight", "maxspeed", "incline", "curb", "surface"]
Wheelchair: ["type", "weight", "maxspeed", "incline", "curb", "surface", "wheelchairWidth"]
},
//Whitelist for settings to be stored in permalink
permalinkKeys: {
Expand All @@ -740,6 +758,7 @@ angular.module("orsApp").constant("lists", {
surface: "h1",
incline: "h2",
curb: "h3",
wheelchairWidth: "h4",
method: "i",
isovalue: "j1",
isointerval: "j2",
Expand Down
3 changes: 3 additions & 0 deletions app/infrastructure/ors-params-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ angular.module("orsApp.params-service", []).factory("orsParamsService", [
if (permalinkKeysReversed[key] == "curb") {
settings.profile.options.curb = value;
}
if (permalinkKeysReversed[key] == "wheelchairWidth") {
settings.profile.options.wheelchairWidth = value;
}
if (permalinkKeysReversed[key] == "method") {
settings.profile.options.analysis_options.method = value;
}
Expand Down
1 change: 1 addition & 0 deletions app/infrastructure/ors-settings-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ angular.module("orsApp.settings-service", []).factory("orsSettingsFactory", [
return orsSettingsFactory[currentSettingsObj].getValue().profile.options;
};
orsSettingsFactory.setActiveOptions = (options, fireRequest) => {
console.log(options);
orsSettingsFactory[
currentSettingsObj
].getValue().profile.options = options;
Expand Down
2 changes: 2 additions & 0 deletions app/infrastructure/ors-utils-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ angular.module("orsApp.utils-service", []).factory("orsUtilsService", [
options.profile_params.restrictions.maximum_sloped_curb = settings.profile.options.curb.toString();
if (settings.profile.options.incline)
options.profile_params.restrictions.maximum_incline = settings.profile.options.incline.toString();
if (settings.profile.options.wheelchairWidth)
options.profile_params.restrictions.minimum_width = settings.profile.options.wheelchairWidth.toString();
}
if (angular.equals(options.profile_params.weightings, {}))
delete options.profile_params.weightings;
Expand Down
1 change: 1 addition & 0 deletions app/languages/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Oberfläche",
"INCLINE": "Anstieg",
"CURB": "Bordsteinhöhe",
"WHEELCHAIR_WIDTH" : "Mindestbreite",
"ISOCHRONES": "Isochronen",
"ISOCHRONEMETHOD": "Isochronen Methode",
"TIMEDISTANCE": "Distanz",
Expand Down
1 change: 1 addition & 0 deletions app/languages/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Surface",
"INCLINE": "Incline",
"CURB": "Curb",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Isochrones",
"ISOCHRONEMETHOD": "Isochrone method",
"TIMEDISTANCE": "Time",
Expand Down
1 change: 1 addition & 0 deletions app/languages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Surface",
"INCLINE": "Incline",
"CURB": "Curb",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Isochroƒnes",
"ISOCHRONEMETHOD": "Isochrone method",
"TIMEDISTANCE": "Time",
Expand Down
1 change: 1 addition & 0 deletions app/languages/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Superficie",
"INCLINE": "Inclinación",
"CURB": "Bordillo",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Isócronas",
"ISOCHRONEMETHOD": "Metódo para calcular Isócronas",
"TIMEDISTANCE": "Tiempo de distancia",
Expand Down
1 change: 1 addition & 0 deletions app/languages/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Surface",
"INCLINE": "Inclinaison",
"CURB": "Trottoir",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Isochrones",
"ISOCHRONEMETHOD": "Méthode isochrone",
"TIMEDISTANCE": "Temps",
Expand Down
1 change: 1 addition & 0 deletions app/languages/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Superficie",
"INCLINE": "Inclinazione",
"CURB": "Ostacoli a gradino",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Isocrone",
"ISOCHRONEMETHOD": "Metodo iscorone",
"TIMEDISTANCE": "Tempo",
Expand Down
1 change: 1 addition & 0 deletions app/languages/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Nawierzchnia",
"INCLINE": "Nachylenie",
"CURB": "Garb",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Izochrony",
"ISOCHRONEMETHOD": "Metoda izochron",
"TIMEDISTANCE": "Czas",
Expand Down
1 change: 1 addition & 0 deletions app/languages/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Superfície",
"INCLINE": "Inclinação",
"CURB": "Lancil",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Isocronas",
"ISOCHRONEMETHOD": "Método para cálculo de Isocronas",
"TIMEDISTANCE": "Tempo",
Expand Down
1 change: 1 addition & 0 deletions app/languages/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "Поверхность",
"INCLINE": "Подъём",
"CURB": "Бордюр",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "Зоны доступности",
"ISOCHRONEMETHOD": "Метод расчёта",
"TIMEDISTANCE": "Время",
Expand Down
1 change: 1 addition & 0 deletions app/languages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"SURFACE": "路面",
"INCLINE": "斜坡",
"CURB": "边道",
"WHEELCHAIR_WIDTH" : "Minimum width",
"ISOCHRONES": "等值线",
"ISOCHRONEMETHOD": "等值算法",
"TIMEDISTANCE": "时间",
Expand Down

0 comments on commit 76bdfb7

Please sign in to comment.