# HG changeset patch # User Thomas Junk # Date 1538126630 -7200 # Node ID 07be3e5f99a9a81d960d695598a5a1080de55360 # Parent 0f61bfc2104145372c23e3808e20e09f20b4047f WIP Fairwayprofile diff -r 0f61bfc21041 -r 07be3e5f99a9 client/src/application/Main.vue --- a/client/src/application/Main.vue Fri Sep 28 10:56:03 2018 +0200 +++ b/client/src/application/Main.vue Fri Sep 28 11:23:50 2018 +0200 @@ -2,7 +2,7 @@
- +
@@ -50,7 +50,8 @@ "maxAlt", "totalLength", "waterLevels", - "fairwayCoordinates" + "fairwayCoordinates", + "selectedWaterLevel" ]), xAxis() { return [this.xScale.x, this.xScale.y]; diff -r 0f61bfc21041 -r 07be3e5f99a9 client/src/fairway/Fairwayprofile.vue --- a/client/src/fairway/Fairwayprofile.vue Fri Sep 28 10:56:03 2018 +0200 +++ b/client/src/fairway/Fairwayprofile.vue Fri Sep 28 11:23:50 2018 +0200 @@ -47,7 +47,8 @@ "margin", "totalLength", "waterLevels", - "fairwayCoordinates" + "fairwayCoordinates", + "selectedWaterLevel" ], computed: { waterColor() { @@ -58,9 +59,7 @@ } }, data() { - return { - selectedWaterLevel: this.waterLevels[0].level - }; + return {}; }, watch: { data() { diff -r 0f61bfc21041 -r 07be3e5f99a9 client/src/fairway/store.js --- a/client/src/fairway/store.js Fri Sep 28 10:56:03 2018 +0200 +++ b/client/src/fairway/store.js Fri Sep 28 11:23:50 2018 +0200 @@ -9,14 +9,18 @@ maxAlt: 0, currentProfile: [], waterLevels: [ - { year: "2016", level: 0, color: "#005DFF" }, - { year: "2017", level: -0.5, color: "#639CFF" } + { year: "2016", level: 149.3, color: "#005DFF" }, + { year: "2017", level: 148.2, color: "#639CFF" } ], + selectedWaterLevel: 149.3, fairwayCoordinates: [], startPoint: null, endPoint: null }, getters: { + selectedWaterLevel: state => { + return state.selectedWaterLevel; + }, fairwayCoordinates: state => { return state.fairwayCoordinates; }, @@ -46,6 +50,9 @@ } }, mutations: { + setSelectedWaterLevel: (state, level) => { + state.selectedWaterLevel = level; + }, profileLoaded: (state, response) => { const { data } = response; const coordinates = data.geometry.coordinates;