Mercurial > gemma
diff client/src/components/map/layers.js @ 3507:a606d003730c
client: spuc12: implemented diagram for reference gauge of bottlenecks
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 28 May 2019 14:52:57 +0200 |
parents | c5c7cc24fe72 |
children | 47c61ea894b1 |
line wrap: on
line diff
--- a/client/src/components/map/layers.js Tue May 28 13:47:18 2019 +0200 +++ b/client/src/components/map/layers.js Tue May 28 14:52:57 2019 +0200 @@ -52,7 +52,7 @@ JSON.stringify(response.data) ); if (featurePostProcessor) { - features.map(f => featurePostProcessor(f, store)); + features.map(f => featurePostProcessor(f, store, features)); } vectorSource.addFeatures(features); }) @@ -532,7 +532,23 @@ }, source, true, - async (f, store) => { + // since we don't use bbox strategy, features will contain all features and we can use it + // to find reference gauges for bottlenecks, yeah! + async (f, store, features) => { + // attach reference gauge to bottleneck + if (f.getId().indexOf("bottlenecks") > -1) { + f.set( + "gauge_obj", + features.find(feat => { + return ( + feat.getId().indexOf("gauges") > -1 && + feat.get("objname") === f.get("gauge_objname") + ); + }) + ); + } + + // attach nsc data to gauge if (f.getId().indexOf("gauges") > -1) { // look for nashSutcliffeOverview in store. If present and // not older than 15 min use it or fetch new data and store it.