From 100c4ec830c6e1a0e937d763e4697b060fd8babf Mon Sep 17 00:00:00 2001 From: Amandus Butzer Date: Mon, 10 Aug 2020 15:32:20 +0200 Subject: [PATCH 1/4] Update height graph & graph style --- CHANGELOG.md | 5 + app/components/ors-map/ors-map.js | 5 + package-lock.json | 210 ++++++++++++++++++++++++++++-- package.json | 2 +- 4 files changed, 209 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98b64bb6..30c95f57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Deprecated ### Removed--> +## [Unreleased] + +### Changed +- leaflet.heightgraph version & style + ## [v0.5.4] - 2020-07-23 ### Fixed diff --git a/app/components/ors-map/ors-map.js b/app/components/ors-map/ors-map.js index 10b0f01a..a54361a4 100755 --- a/app/components/ors-map/ors-map.js +++ b/app/components/ors-map/ors-map.js @@ -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 = {}; diff --git a/package-lock.json b/package-lock.json index 41ab7a41..e1109dd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -596,14 +596,126 @@ } }, "brfs": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/brfs/-/brfs-1.4.3.tgz", - "integrity": "sha1-22ddb16SPm3wh/ylhZyQkKrtMhY=", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/brfs/-/brfs-1.6.1.tgz", + "integrity": "sha512-OfZpABRQQf+Xsmju8XE9bDjs+uU4vLREGolP7bDgcpsI17QREyZ4Bl+2KLxxx1kCgA0fAIhKQBaBYh+PEcCqYQ==", "requires": { "quote-stream": "^1.0.1", "resolve": "^1.1.5", - "static-module": "^1.1.0", + "static-module": "^2.2.0", "through2": "^2.0.0" + }, + "dependencies": { + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "escodegen": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", + "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, + "object-inspect": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.4.1.tgz", + "integrity": "sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true + }, + "static-eval": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.0.tgz", + "integrity": "sha512-agtxZ/kWSsCkI5E4QifRwsaPs0P0JmZV6dkLz6ILYfFYQGn+5plctanRN+IC8dJRiFkyXHrwEE3W9Wmx67uDbw==", + "requires": { + "escodegen": "^1.11.1" + }, + "dependencies": { + "escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + } + } + }, + "static-module": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/static-module/-/static-module-2.2.5.tgz", + "integrity": "sha512-D8vv82E/Kpmz3TXHKG8PPsCPg+RAX6cbCOyvjM6x04qZtQ47EtJFVwRsdov3n5d6/6ynrOY9XB4JkaZwB2xoRQ==", + "requires": { + "concat-stream": "~1.6.0", + "convert-source-map": "^1.5.1", + "duplexer2": "~0.1.4", + "escodegen": "~1.9.0", + "falafel": "^2.1.0", + "has": "^1.0.1", + "magic-string": "^0.22.4", + "merge-source-map": "1.0.4", + "object-inspect": "~1.4.0", + "quote-stream": "~1.0.2", + "readable-stream": "~2.3.3", + "shallow-copy": "~0.0.1", + "static-eval": "^2.0.0", + "through2": "~2.0.3" + } + } } }, "brorand": { @@ -2707,6 +2819,11 @@ } } }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, "fast-safe-stringify": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", @@ -4551,6 +4668,19 @@ "togeojson": "0.13.0", "topojson": "1.6.26", "wellknown": "0.4.2" + }, + "dependencies": { + "brfs": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/brfs/-/brfs-1.4.3.tgz", + "integrity": "sha1-22ddb16SPm3wh/ylhZyQkKrtMhY=", + "requires": { + "quote-stream": "^1.0.1", + "resolve": "^1.1.5", + "static-module": "^1.1.0", + "through2": "^2.0.0" + } + } } }, "leaflet.featuregroup.subgroup": { @@ -4559,9 +4689,9 @@ "integrity": "sha1-/7yW6m20GJO21ftgugnxOHbEXSg=" }, "leaflet.heightgraph": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/leaflet.heightgraph/-/leaflet.heightgraph-1.1.0.tgz", - "integrity": "sha512-BkMpofD/Y9sL/AbQNWokHPs+pPmQqDuYKWZvjMx+IleC26lvTirr3llGsA0yZXr5A2UJcMjok+xsI/be0dImrQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/leaflet.heightgraph/-/leaflet.heightgraph-1.3.2.tgz", + "integrity": "sha512-GdNQdkxJziBItFwWPN8teeg4UUzQWEizh5w7VU9JJ8VNMSfqVCvk/D4aOFL6OhTAamUbFSYn6FWQAuyOJvQlSg==", "requires": { "leaflet": "^1.6.0" } @@ -4591,6 +4721,15 @@ } } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "liftoff": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", @@ -4755,6 +4894,14 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" }, + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "requires": { + "vlq": "^0.2.2" + } + }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -4866,6 +5013,14 @@ "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", "dev": true }, + "merge-source-map": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", + "integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=", + "requires": { + "source-map": "^0.5.6" + } + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -5328,6 +5483,19 @@ } } }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -5622,6 +5790,11 @@ "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, "preprocess": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/preprocess/-/preprocess-3.2.0.tgz", @@ -7515,6 +7688,14 @@ "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==" }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "~1.1.2" + } + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -7705,6 +7886,11 @@ "homedir-polyfill": "^1.0.1" } }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==" + }, "vm-browserify": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", @@ -7953,6 +8139,11 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -8216,11 +8407,6 @@ "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", "dev": true - }, - "zone.js": { - "version": "0.6.12", - "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.6.12.tgz", - "integrity": "sha1-NGqoP05Qk/uYsxwkH02u2SkKzO4=" } } } diff --git a/package.json b/package.json index 2511e1f0..3d32ed62 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "leaflet-distance-markers": "git+https://github.com/adoroszlai/leaflet-distance-markers.git", "leaflet-geometryutil": "^0.8.1", "leaflet-omnivore": "^0.3.4", - "leaflet.heightgraph": "^1.1.0", + "leaflet.heightgraph": "^1.3.2", "leaflet.featuregroup.subgroup": "^1.0.2", "togpx": "^0.5.4", "tokml": "^0.4.0", From 230b3809ba38e54472c4d00d778aacc36843e092 Mon Sep 17 00:00:00 2001 From: Amandus Butzer Date: Mon, 10 Aug 2020 16:05:23 +0200 Subject: [PATCH 2/4] Remove fastest weighting option default is now recommended which is fastest for car closes https://github.com/GIScience/openrouteservice-app/issues/315 --- CHANGELOG.md | 4 ++++ .../ors-route-controls/ors-options/ors-options.js | 7 ++----- app/constants/lists.js | 8 ++------ app/infrastructure/ors-params-service.js | 4 ++++ app/languages/de-DE.json | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c95f57..4248878a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js b/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js index 64b3f155..36cfdc8d 100755 --- a/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js +++ b/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js @@ -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, diff --git a/app/constants/lists.js b/app/constants/lists.js index bfb33697..85e897cc 100755 --- a/app/constants/lists.js +++ b/app/constants/lists.js @@ -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: { diff --git a/app/infrastructure/ors-params-service.js b/app/infrastructure/ors-params-service.js index 530f9442..645fc56f 100755 --- a/app/infrastructure/ors-params-service.js +++ b/app/infrastructure/ors-params-service.js @@ -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 = diff --git a/app/languages/de-DE.json b/app/languages/de-DE.json index e7651060..d29785f9 100755 --- a/app/languages/de-DE.json +++ b/app/languages/de-DE.json @@ -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", From b8d0b14aeacf0280042b3abc394b6ec56013eea3 Mon Sep 17 00:00:00 2001 From: Amandus Butzer Date: Mon, 10 Aug 2020 17:14:13 +0200 Subject: [PATCH 3/4] Add maximum speed option for driving-* profiles --- CHANGELOG.md | 8 +++- .../ors-options/ors-options.html | 10 +++++ .../ors-options/ors-options.js | 37 +++++++++++++++++++ app/constants/lists.js | 21 +++++++---- app/infrastructure/ors-params-service.js | 4 +- app/infrastructure/ors-utils-service.js | 5 ++- 6 files changed, 72 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4248878a..a0491fa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,12 +14,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### 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 weigthing option to recommended ([#315](https://github.com/GIScience/openrouteservice-app/issues/315)) +- 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)) +- `fastest` weighting option ([#315](https://github.com/GIScience/openrouteservice-app/issues/315)) ## [v0.5.4] - 2020-07-23 diff --git a/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.html b/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.html index 97ab1174..998ecb55 100755 --- a/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.html +++ b/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.html @@ -17,6 +17,16 @@ +
+
+ + + +
+ + +
diff --git a/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js b/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js index 36cfdc8d..590c10d8 100755 --- a/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js +++ b/app/components/ors-panel-routing/ors-waypoints/ors-route-controls/ors-options/ors-options.js @@ -183,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 + " km/h"; + }, + onEnd: () => { + ctrl.currentOptions.maximum_speed = ctrl.maximumSpeedSlider.value; + ctrl.changeOptions(); + } + } + }; + ctrl.toggleMaximumSpeedSlider(false); ctrl.greenActive = false; ctrl.toggleGreenSlider = (fireRequest = true) => { if (ctrl.greenActive === true) { diff --git a/app/constants/lists.js b/app/constants/lists.js index 85e897cc..047bc8a3 100755 --- a/app/constants/lists.js +++ b/app/constants/lists.js @@ -395,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 @@ -491,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", @@ -506,7 +512,7 @@ angular.module("orsApp").constant("lists", { goods: [ "type", "weight", - "maxspeed", + "maximum_speed", "height", "width", "length", @@ -517,7 +523,7 @@ angular.module("orsApp").constant("lists", { bus: [ "type", "weight", - "maxspeed", + "maximum_speed", "height", "width", "length", @@ -528,7 +534,7 @@ angular.module("orsApp").constant("lists", { agricultural: [ "type", "weight", - "maxspeed", + "maximum_speed", "height", "width", "length", @@ -539,7 +545,7 @@ angular.module("orsApp").constant("lists", { forestry: [ "type", "weight", - "maxspeed", + "maximum_speed", "height", "width", "length", @@ -550,7 +556,7 @@ angular.module("orsApp").constant("lists", { delivery: [ "type", "weight", - "maxspeed", + "maximum_speed", "height", "width", "length", @@ -580,6 +586,7 @@ angular.module("orsApp").constant("lists", { wps: "a", type: "b", weight: "c", + maximum_speed: "d", hgvWeight: "f1", width: "f2", height: "f3", diff --git a/app/infrastructure/ors-params-service.js b/app/infrastructure/ors-params-service.js index 645fc56f..e23cab67 100755 --- a/app/infrastructure/ors-params-service.js +++ b/app/infrastructure/ors-params-service.js @@ -93,7 +93,7 @@ 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" + value = "0"; } for (let weightType in lists.optionList.weight) { if (lists.optionList.weight[weightType].shortValue === value) { @@ -109,7 +109,7 @@ angular.module("orsApp.params-service", []).factory("orsParamsService", [ } if ( [ - "maxspeed", + "maximum_speed", "hgvWeight", "width", "height", diff --git a/app/infrastructure/ors-utils-service.js b/app/infrastructure/ors-utils-service.js index b9f46efc..cc9fb080 100755 --- a/app/infrastructure/ors-utils-service.js +++ b/app/infrastructure/ors-utils-service.js @@ -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(); @@ -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) & From ee2edbd4a1eb99a6a580d2bad69e7ec1f20b1a0f Mon Sep 17 00:00:00 2001 From: Amandus Butzer Date: Mon, 10 Aug 2020 17:18:53 +0200 Subject: [PATCH 4/4] Release v0.6.0 --- CHANGELOG.md | 2 +- app/components/ors-navigation/ors-nav.js | 2 +- app/infrastructure/ors-importexport-service.js | 2 +- app/js/app.js | 2 +- bower.json | 2 +- package-lock.json | 2 +- package.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0491fa2..ab805968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Deprecated ### Removed--> -## [Unreleased] +## [v0.6.0] - 2020-08-10 ### Added - maximum_speed for `driving-*` profiles. diff --git a/app/components/ors-navigation/ors-nav.js b/app/components/ors-navigation/ors-nav.js index 73135348..2662e2e7 100755 --- a/app/components/ors-navigation/ors-nav.js +++ b/app/components/ors-navigation/ors-nav.js @@ -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: [ diff --git a/app/infrastructure/ors-importexport-service.js b/app/infrastructure/ors-importexport-service.js index 0aa4144b..c29951ab 100755 --- a/app/infrastructure/ors-importexport-service.js +++ b/app/infrastructure/ors-importexport-service.js @@ -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; diff --git a/app/js/app.js b/app/js/app.js index d9eb9d88..f9efb503 100755 --- a/app/js/app.js +++ b/app/js/app.js @@ -10,7 +10,7 @@ *|------------------------------------------------------------------------------------*/ /** * @author: Amandus Butzer, amandus@openrouteservice.org, Timothy Ellersiek, timothy@openrouteservice.org - * @version: 0.5.4 + * @version: 0.6.0 */ (function(searchString, position) { fetchData().then(bootstrapApplication); diff --git a/bower.json b/bower.json index 9e70aa03..e5006b62 100755 --- a/bower.json +++ b/bower.json @@ -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, diff --git a/package-lock.json b/package-lock.json index e1109dd2..91174164 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "maps.openrouteservice.org", - "version": "0.5.4", + "version": "0.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3d32ed62..31fa44d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maps.openrouteservice.org", - "version": "0.5.4", + "version": "0.6.0", "repository": { "type": "git", "url": "https://github.com/GIScience/openrouteservice-app.git"