Skip to content

Commit

Permalink
Merge pull request #341 from GIScience/release-v0.6.0
Browse files Browse the repository at this point in the history
Release v0.6.0
  • Loading branch information
TheGreatRefrigerator authored Aug 10, 2020
2 parents cdeaab8 + ee2edbd commit af590d1
Show file tree
Hide file tree
Showing 14 changed files with 297 additions and 41 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Deprecated
### Removed-->

## [v0.6.0] - 2020-08-10

### Added
- maximum_speed for `driving-*` profiles.
The option works for speeds down to `80` km/h (See [ors backend issue #480](https://github.com/GIScience/openrouteservice/issues/480))

### Changed
- leaflet.heightgraph version & style
- default weighting 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

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions app/components/ors-map/ors-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ angular.module("orsApp").directive("orsMap", () => {
color: "rgb(0,243,235)",
opacity: 0.7,
weight: 6
},
graphStyle: {
opacity: 0.8,
"fill-opacity": 0.6,
"stroke-width": "2px"
}
});
$scope.alternativeRouteLayers = {};
Expand Down
2 changes: 1 addition & 1 deletion app/components/ors-navigation/ors-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ angular
if ($location.path() === "/") {
ctrl.activeMenu = "/directions";
} else ctrl.activeMenu = $location.path();
ctrl.version = "0.5.4";
ctrl.version = "0.6.0";
}
],
$routeConfig: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
</rzslider>
</div>
</div>
<div class="ors-options-menu" ng-show="$ctrl.activeSubgroup == 'Car' || $ctrl.activeSubgroup == 'HeavyVehicle'">
<div class="ui checkbox">
<input id="maximum_speed" name="orsRouteMaximumspeedInput" ng-change="$ctrl.toggleMaximumSpeedSlider()" ng-model="$ctrl.maxspeedCheckbox" type="checkbox">
<label for="maximum_speed" ng-bind-html="('MAXIMUMSPEED' | translate)">
</label>
</input>
</div>
<rzslider rz-slider-model="$ctrl.maximumSpeedSlider.value" rz-slider-options="$ctrl.maximumSpeedSlider.options">
</rzslider>
</div>
</div>
<div class="options-box" ng-if="$ctrl.routing">
<div class="pointer" ng-click="$ctrl.roundTripOptions = !$ctrl.roundTripOptions">
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 Expand Up @@ -186,6 +183,43 @@ angular.module("orsApp.ors-options", []).component("orsOptions", {
ctrl.currentOptions.round_trip.seed = ctrl.roundTripSeed.value;
ctrl.changeOptions();
};
// set maximum_speed slider from params
const { min, max, preset, step } = lists.optionList.maximum_speed;
// enable or disable checkbox depending on whether maximum_speed is set
let maximumSpeedValue;
if (ctrl.currentOptions.maximum_speed >= 0) {
maximumSpeedValue = ctrl.currentOptions.maximum_speed;
ctrl.maxspeedCheckbox = true;
} else {
maximumSpeedValue = preset;
ctrl.maxspeedCheckbox = false;
}
ctrl.toggleMaximumSpeedSlider = (fireRequest = true) => {
if (ctrl.maxspeedCheckbox === true) {
ctrl.maximumSpeedSlider.options.disabled = false;
ctrl.currentOptions.maximum_speed = ctrl.maximumSpeedSlider.value;
} else if (ctrl.maxspeedCheckbox === false) {
ctrl.maximumSpeedSlider.options.disabled = true;
delete ctrl.currentOptions.maximum_speed;
}
if (fireRequest) ctrl.changeOptions();
};
ctrl.maximumSpeedSlider = {
value: maximumSpeedValue,
options: {
floor: min,
ceil: max,
step: step,
translate: value => {
return value + " <b>km/h</b>";
},
onEnd: () => {
ctrl.currentOptions.maximum_speed = ctrl.maximumSpeedSlider.value;
ctrl.changeOptions();
}
}
};
ctrl.toggleMaximumSpeedSlider(false);
ctrl.greenActive = false;
ctrl.toggleGreenSlider = (fireRequest = true) => {
if (ctrl.greenActive === true) {
Expand Down
29 changes: 16 additions & 13 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 Expand Up @@ -399,6 +395,12 @@ angular.module("orsApp").constant("lists", {
value: "axleload"
}
},
maximum_speed: {
min: 80,
max: 120,
preset: 100,
step: 1
},
green: {
min: 0.1,
max: 1
Expand Down Expand Up @@ -495,11 +497,11 @@ angular.module("orsApp").constant("lists", {
permalinkFilters: {
avoidables: ["ferry", "fords", "steps", "highways", "tollroads"],
analysis: ["method", "isovalue", "isointerval", "reverseflow"],
Car: ["type", "weight", "maxspeed"],
Car: ["type", "weight", "maximum_speed"],
hgv: [
"type",
"weight",
"maxspeed",
"maximum_speed",
"height",
"width",
"length",
Expand All @@ -510,7 +512,7 @@ angular.module("orsApp").constant("lists", {
goods: [
"type",
"weight",
"maxspeed",
"maximum_speed",
"height",
"width",
"length",
Expand All @@ -521,7 +523,7 @@ angular.module("orsApp").constant("lists", {
bus: [
"type",
"weight",
"maxspeed",
"maximum_speed",
"height",
"width",
"length",
Expand All @@ -532,7 +534,7 @@ angular.module("orsApp").constant("lists", {
agricultural: [
"type",
"weight",
"maxspeed",
"maximum_speed",
"height",
"width",
"length",
Expand All @@ -543,7 +545,7 @@ angular.module("orsApp").constant("lists", {
forestry: [
"type",
"weight",
"maxspeed",
"maximum_speed",
"height",
"width",
"length",
Expand All @@ -554,7 +556,7 @@ angular.module("orsApp").constant("lists", {
delivery: [
"type",
"weight",
"maxspeed",
"maximum_speed",
"height",
"width",
"length",
Expand Down Expand Up @@ -584,6 +586,7 @@ angular.module("orsApp").constant("lists", {
wps: "a",
type: "b",
weight: "c",
maximum_speed: "d",
hgvWeight: "f1",
width: "f2",
height: "f3",
Expand Down
2 changes: 1 addition & 1 deletion app/infrastructure/ors-importexport-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ angular
// create a simple Course TCX file (MARQ24)
// see https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd
let toTcx = (name, speedInKmPerH) => {
let version = "0.5.4";
let version = "0.6.0";
let pointInformation =
orsRouteService.data.features[orsRouteService.getCurrentRouteIdx()]
.point_information;
Expand Down
6 changes: 5 additions & 1 deletion 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 All @@ -105,7 +109,7 @@ angular.module("orsApp.params-service", []).factory("orsParamsService", [
}
if (
[
"maxspeed",
"maximum_speed",
"hgvWeight",
"width",
"height",
Expand Down
5 changes: 3 additions & 2 deletions app/infrastructure/ors-utils-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ angular.module("orsApp.utils-service", []).factory("orsUtilsService", [
}
}

// maximum speed
if (settings.profile.options.maximum_speed && payload.profile.startsWith("driving"))
payload.maximum_speed = settings.profile.options.maximum_speed.toString();
// extras
payload.extra_info = [];
const extra_infos = orsUtilsService.getExtraInformation();
Expand Down Expand Up @@ -300,8 +303,6 @@ angular.module("orsApp.utils-service", []).factory("orsUtilsService", [
}
if (vt !== 0) options.vehicle_type = settings.profile.type;
}
if (settings.profile.options.maxspeed)
options.maximum_speed = settings.profile.options.maxspeed.toString();
if (subgroup === "Bicycle") {
if (
(settings.profile.options.steepness > 0) &
Expand Down
2 changes: 1 addition & 1 deletion app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*|------------------------------------------------------------------------------------*/
/**
* @author: Amandus Butzer, [email protected], Timothy Ellersiek, [email protected]
* @version: 0.5.4
* @version: 0.6.0
*/
(function(searchString, position) {
fetchData().then(bootstrapApplication);
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
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openrouteservice.org",
"description": "angular version of openrouteservice.org",
"version": "0.5.4",
"version": "0.6.0",
"homepage": "http://www.heigit.org",
"license": "ISC",
"private": true,
Expand Down
Loading

0 comments on commit af590d1

Please sign in to comment.