changeset 3465:3c13a6f2227b

afd(LNWL): additional queryparams (widthbreaks, depthbreaks) for sections and stretches implemented
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 27 May 2019 10:38:42 +0200
parents 5b50261b85ef
children dfa97aad1134
files client/src/store/fairwayavailability.js
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/store/fairwayavailability.js	Mon May 27 10:23:32 2019 +0200
+++ b/client/src/store/fairwayavailability.js	Mon May 27 10:38:42 2019 +0200
@@ -214,7 +214,6 @@
           limitingFactor,
           type
         } = options;
-        if (type !== TYPES.BOTTLENECKS) return;
         let { from, to } = options;
         let name =
           feature.constructor.name === "Feature"
@@ -231,6 +230,14 @@
             if (limitingFactor === LIMITINGFACTORS.WIDTH)
               additionalParams = `&breaks=${widthLimit1},${widthLimit2}`;
             break;
+          case TYPES.SECTIONS:
+            endpoint = "section";
+            additionalParams = `&depthbreaks=${depthLimit1},${depthLimit2}&widthbreaks=${widthLimit1},${widthLimit2}`;
+            break;
+          case TYPES.STRETCHES:
+            endpoint = "stretch";
+            additionalParams = `&depthbreaks=${depthLimit1},${depthLimit2}&widthbreaks=${widthLimit1},${widthLimit2}`;
+            break;
           default:
             throw new Error("Wrong selection");
         }
@@ -287,6 +294,14 @@
             if (limitingFactor === LIMITINGFACTORS.WIDTH)
               additionalParams = `&breaks=${widthLimit1},${widthLimit2}`;
             break;
+          case TYPES.SECTIONS:
+            endpoint = "section";
+            additionalParams = `&depthbreaks=${depthLimit1},${depthLimit2}&widthbreaks=${widthLimit1},${widthLimit2}`;
+            break;
+          case TYPES.STRETCHES:
+            endpoint = "stretch";
+            additionalParams = `&depthbreaks=${depthLimit1},${depthLimit2}&widthbreaks=${widthLimit1},${widthLimit2}`;
+            break;
           default:
             endpoint = "bottleneck";
             break;