changeset 5249:d855426a6e5d new-fwa

Fixed frontend for sections and stretches in new FWA implementation. This fix is not very elegant, but at least it is correct.
author Sascha Wilde <wilde@intevation.de>
date Tue, 12 May 2020 22:55:10 +0200
parents 8c44b518141a
children 13e1767b63a1
files client/src/store/fairwayavailability.js
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/store/fairwayavailability.js	Tue May 12 22:35:33 2020 +0200
+++ b/client/src/store/fairwayavailability.js	Tue May 12 22:55:10 2020 +0200
@@ -260,9 +260,16 @@
           type
         } = options;
         let { from, to } = options;
-        let name = feature.hasOwnProperty("properties")
-          ? feature.properties.bottleneck_id
-          : feature.get("bottleneck_id");
+        let name = "";
+        if (type === TYPES.BOTTLENECK) {
+          name = feature.hasOwnProperty("properties")
+            ? feature.properties.bottleneck_id
+            : feature.get("bottleneck_id");
+        } else {
+          name = feature.hasOwnProperty("properties")
+            ? feature.properties.name
+            : feature.get("objnam");
+        }
         [from, to] = getIntervallBorders(from, to, frequency);
         let additionalParams = "";
         let endpoint = type;