diff client/src/application/Main.vue @ 1025:a55f20dc8d8d

refac: store profiles by date
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 24 Oct 2018 13:09:54 +0200
parents ca628dce90dd
children 04a9e78dcc5f
line wrap: on
line diff
--- a/client/src/application/Main.vue	Wed Oct 24 12:29:25 2018 +0200
+++ b/client/src/application/Main.vue	Wed Oct 24 13:09:54 2018 +0200
@@ -1,8 +1,29 @@
 <template>
     <div class="main d-flex flex-column">
-        <Maplayer :drawMode="drawMode" :split="isSplitscreen" :lat="6155376" :long="1819178" :zoom="11"></Maplayer>
+        <Maplayer
+            :drawMode="drawMode"
+            :split="isSplitscreen"
+            :lat="6155376"
+            :long="1819178"
+            :zoom="11"
+        ></Maplayer>
         <div v-if="isSplitscreen" class="profile d-flex flex-row">
-            <FairwayProfile :additionalSurveys="additionalSurveys" :minAlt="minAlt" maxAlt="maxAlt" :selectedWaterLevel="selectedWaterLevel" :fairwayCoordinates="fairwayCoordinates" :waterLevels="waterLevels" :data="currentProfile" :height="height" :width="width" :xScale="xAxis" :yScaleLeft="yAxisLeft" :yScaleRight="yAxisRight" :margin="margins" :totalLength="totalLength"></FairwayProfile>
+            <FairwayProfile
+                :additionalSurveys="additionalSurveys"
+                :minAlt="minAlt"
+                maxAlt="maxAlt"
+                :selectedWaterLevel="selectedWaterLevel"
+                :fairwayCoordinates="fairwayCoordinates"
+                :waterLevels="waterLevels"
+                :data="coordinates"
+                :height="height"
+                :width="width"
+                :xScale="xAxis"
+                :yScaleLeft="yAxisLeft"
+                :yScaleRight="yAxisRight"
+                :margin="margins"
+                :totalLength="totalLength"
+            ></FairwayProfile>
         </div>
     </div>
 </template>
@@ -66,6 +87,10 @@
       "availableSurveys"
     ]),
     ...mapState("morphstore", ["selectedMorph"]),
+    coordinates() {
+      const currentSurveyDate = this.selectedMorph.date_info;
+      return this.currentProfile[currentSurveyDate];
+    },
     additionalSurveys() {
       if (!this.availableSurveys) return [];
       return this.availableSurveys.surveys.filter(x => {