Mercurial > gemma
annotate client/src/components/map/fairway/Profiles.vue @ 1394:b350b0b5cb6c
refactored fairwayprofile cross cuts
moved all profile relevant data into Fairwayprofile.vue
fixed width calculation of diagram
fix bug when switching between sounding data
fixed display/styling issue
code cleanup
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 28 Nov 2018 11:48:45 +0100 |
parents | 801ae5f4bc5b |
children | 210e9f16f8a0 |
rev | line source |
---|---|
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
2 <div :class="['box ui-element rounded bg-white text-nowrap', { expanded: showProfiles }]"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
3 <div style="width: 20rem"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
4 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
5 <font-awesome-icon icon="chart-area" class="mr-2"></font-awesome-icon> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 Profiles |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 <font-awesome-icon |
1379 | 8 icon="times" |
9 class="ml-auto text-muted" | |
10 @click="$store.commit('application/showProfiles', false)" | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 ></font-awesome-icon> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
12 </h6> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 <div class="d-flex flex-column p-3 flex-grow-1 text-left position-relative"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 <div class="loading d-flex justify-content-center align-items-center" v-if="surveysLoading || profileLoading"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 <font-awesome-icon icon="spinner" spin /> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 <small class="text-muted">Bottleneck:</small> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 <select @click="moveToBottleneck" v-model="selectedBottleneck" class="form-control form-control-sm"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 <option :value="null">Select Bottleneck</option> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 <option |
1379 | 21 v-for="bn in bottlenecks" |
22 :key="bn.properties.name" | |
23 :value="bn.properties.name" | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 >{{ bn.properties.name }}</option> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 </select> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 <div v-if="selectedBottleneck"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 <div class="d-flex mt-2"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 <div class="flex-fill"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 <small class="text-muted">Sounding Result:</small> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 <select v-model="selectedSurvey" class="form-control form-control-sm"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 <option |
1379 | 32 v-for="survey in surveys" |
33 :key="survey.date_info" | |
34 :value="survey" | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 >{{ survey.date_info }}</option> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 </select> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 <div class="flex-fill ml-3" v-if="selectedSurvey && surveys.length > 1"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 <small class="text-muted mt-1">Compare with:</small> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 <select v-model="additionalSurvey" class="form-control form-control-sm"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 <option :value="null">None</option> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
42 <option |
1379 | 43 v-for="survey in additionalSurveys" |
44 :key="survey.date_info" | |
45 :value="survey" | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 >{{ survey.date_info }}</option> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 </select> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 <hr class="w-100"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 <small class="d-flex text-left my-2" v-if="startPoint && endPoint"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 <div class="text-nowrap mr-3"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 <b>Start:</b> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 <br> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 Lat: {{ startPoint[1] }} |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 <br> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 Lon: {{ startPoint[0] }} |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 <div class="text-nowrap"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 <b>End:</b> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 <br> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 Lat: {{ endPoint[1] }} |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 <br> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 Lon: {{ endPoint[0] }} |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
66 <button v-clipboard:copy="coordinatesForClipboard" |
1379 | 67 v-clipboard:success="onCopyCoordinates" |
68 class="btn btn-info btn-sm ml-auto mt-auto" | |
69 ><font-awesome-icon icon="copy" /></button> | |
70 </small> | |
71 <div class="d-flex"> | |
72 <div class="pr-3 w-50" v-if="startPoint && endPoint"> | |
73 <button | |
74 class="btn btn-info btn-sm w-100" | |
75 @click="showLabelInput = !showLabelInput" | |
76 > | |
77 <font-awesome-icon :icon="showLabelInput ? 'times' : 'check'" /> | |
78 {{ showLabelInput ? "Cancel" : "Save" }} | |
79 </button> | |
80 </div> | |
81 <div :class="startPoint && endPoint ? 'w-50' : 'w-100'"> | |
82 <button | |
83 class="btn btn-info btn-sm w-100" | |
84 @click="toggleCutTool" | |
85 > | |
86 <font-awesome-icon :icon="cutTool && cutTool.getActive() ? 'times' : 'plus'"></font-awesome-icon> | |
87 {{ cutTool && cutTool.getActive() ? "Cancel" : "New" }} | |
88 </button> | |
89 </div> | |
90 </div> | |
91 <div v-if="showLabelInput" class="mt-2"> | |
92 <small class="text-muted">Enter label for cross profile:</small> | |
93 <div class="position-relative"> | |
94 <input class="form-control form-control-sm pr-5" v-model="cutLabel" /> | |
95 <button | |
96 class="btn btn-sm btn-info position-absolute input-button-right" | |
97 @click="saveCut" | |
98 v-if="cutLabel" | |
99 style="top: 0; right: 0;" | |
100 ><font-awesome-icon icon="check" /></button> | |
101 </div> | |
102 </div> | |
103 <small class="text-muted d-block mt-2">Saved cross profiles:</small> | |
104 <select class="form-control form-control-sm" v-model="coordinatesSelect"> | |
105 <option></option> | |
106 <option v-for="(cut, index) in previousCuts" :value="cut.coordinates" :key="index"> | |
107 {{ cut.label }} | |
108 </option> | |
109 </select> | |
110 <small class="text-muted d-block mt-2">Enter coordinates manually:</small> | |
111 <div class="position-relative"> | |
112 <input class="form-control form-control-sm pr-5" placeholder="Lat,Lon,Lat,Lon" v-model="coordinatesInput" /> | |
113 <button | |
114 class="btn btn-sm btn-info position-absolute input-button-right" | |
115 @click="applyManualCoordinates" | |
116 style="top: 0; right: 0;" | |
117 v-if="coordinatesInputIsValid" | |
118 ><font-awesome-icon icon="check" /></button> | |
119 </div> | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 </template> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 <style lang="sass" scoped> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
127 .loading |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
128 background: rgba(255, 255, 255, 0.96) |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
129 position: absolute |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 z-index: 99 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 top: 0 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
132 right: 0 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
133 bottom: 0 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 left: 0 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
136 .input-button-right |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
137 border-top-right-radius: $border-radius |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
138 border-bottom-right-radius: $border-radius |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
139 border-top-left-radius: 0 !important |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
140 border-bottom-left-radius: 0 !important |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 </style> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
142 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
143 <script> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
144 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
145 * without warranty, see README.md and license for details. |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
146 * |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
147 * SPDX-License-Identifier: AGPL-3.0-or-later |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
148 * License-Filename: LICENSES/AGPL-3.0.txt |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
149 * |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
150 * Copyright (C) 2018 by via donau |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
151 * – Österreichische Wasserstraßen-Gesellschaft mbH |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
152 * Software engineering by Intevation GmbH |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
153 * |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
154 * Author(s): |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
155 * Markus Kottländer <markus.kottlaender@intevation.de> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
156 */ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
157 import { mapState, mapGetters } from "vuex"; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
158 import Feature from "ol/Feature"; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 import LineString from "ol/geom/LineString"; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
160 import { displayError, displayInfo } from "../../../lib/errors.js"; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
161 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
162 export default { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
163 name: "profiles", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
164 data() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
165 return { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
166 coordinatesInput: "", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
167 coordinatesSelect: null, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
168 cutLabel: "", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
169 showLabelInput: false |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
170 }; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
171 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
172 computed: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
173 ...mapGetters("map", ["getVSourceByName"]), |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
174 ...mapState("application", ["showProfiles"]), |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
175 ...mapState("map", ["lineTool", "polygonTool", "cutTool"]), |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
176 ...mapState("bottlenecks", ["bottlenecks", "surveys", "surveysLoading"]), |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 ...mapState("fairwayprofile", [ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 "previousCuts", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 "startPoint", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 "endPoint", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
181 "profileLoading" |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
182 ]), |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
183 selectedBottleneck: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
184 get() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
185 return this.$store.state.bottlenecks.selectedBottleneck; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 set(name) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
188 this.$store.dispatch("bottlenecks/setSelectedBottleneck", name); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
191 selectedSurvey: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
192 get() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
193 return this.$store.state.bottlenecks.selectedSurvey; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 set(survey) { |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
196 this.$store.commit("fairwayprofile/additionalSurvey", null); |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
197 this.$store.commit("bottlenecks/selectedSurvey", survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
198 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
199 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
200 additionalSurvey: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
201 get() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
202 return this.$store.state.fairwayprofile.additionalSurvey; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
203 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
204 set(survey) { |
1391
801ae5f4bc5b
fixed bug when changing additional survey in profile dialog
Markus Kottlaender <markus@intevation.de>
parents:
1382
diff
changeset
|
205 this.$store.commit("fairwayprofile/additionalSurvey", survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
206 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
207 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
208 additionalSurveys() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
209 return this.surveys.filter(survey => survey !== this.selectedSurvey); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
210 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
211 coordinatesForClipboard() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
212 return ( |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
213 this.startPoint[1] + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
214 "," + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
215 this.startPoint[0] + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
216 "," + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
217 this.endPoint[1] + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
218 "," + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
219 this.endPoint[0] |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
220 ); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
221 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
222 coordinatesInputIsValid() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
223 const coordinates = this.coordinatesInput |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
224 .split(",") |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
225 .map(coord => parseFloat(coord.trim())) |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
226 .filter(c => Number(c) === c); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
227 return coordinates.length === 4; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
228 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
229 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
230 watch: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
231 selectedBottleneck() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
232 this.$store.dispatch("fairwayprofile/previousCuts"); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
233 this.cutLabel = |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
234 this.selectedBottleneck + " (" + new Date().toISOString() + ")"; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
235 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
236 selectedSurvey(survey) { |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
237 this.loadProfile(survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
238 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
239 additionalSurvey(survey) { |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
240 this.loadProfile(survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
241 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
242 coordinatesSelect(newValue) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
243 if (newValue) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
244 this.applyCoordinates(newValue); |
1382
8b85032ed3cd
added loading animation to profile
Markus Kottlaender <markus@intevation.de>
parents:
1379
diff
changeset
|
245 this.coordinatesSelect = null; |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
246 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
247 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
248 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
249 methods: { |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
250 loadProfile(survey) { |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
251 if (survey) { |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
252 this.$store.commit("fairwayprofile/profileLoading", true); |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
253 this.$store |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
254 .dispatch("fairwayprofile/loadProfile", survey) |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
255 .finally(() => |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
256 this.$store.commit("fairwayprofile/profileLoading", false) |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
257 ); |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
258 } |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
259 }, |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
260 toggleCutTool() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
261 if (this.selectedSurvey) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
262 this.cutTool.setActive(!this.cutTool.getActive()); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
263 this.lineTool.setActive(false); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
264 this.polygonTool.setActive(false); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
265 this.$store.commit("map/setCurrentMeasurement", null); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
266 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
267 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
268 onCopyCoordinates() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
269 displayInfo({ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
270 title: "Success", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
271 message: "Coordinates copied to clipboard!" |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
272 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
274 applyManualCoordinates() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
275 const coordinates = this.coordinatesInput |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
276 .split(",") |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
277 .map(coord => parseFloat(coord.trim())); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 this.coordinatesSelect = null; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
279 this.coordinatesInput = ""; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
280 this.applyCoordinates([ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
281 coordinates[1], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
282 coordinates[0], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
283 coordinates[3], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
284 coordinates[2] |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
285 ]); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
286 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
287 applyCoordinates(coordinates) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
288 // allow only numbers |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
289 coordinates = coordinates.filter(c => Number(c) === c); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
290 if (coordinates.length === 4) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
291 // draw line on map |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
292 this.getVSourceByName("Cut Tool").clear(); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
293 const cut = new Feature({ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
294 geometry: new LineString([ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
295 [coordinates[0], coordinates[1]], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
296 [coordinates[2], coordinates[3]] |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
297 ]).transform("EPSG:4326", "EPSG:3857") |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
298 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
299 this.getVSourceByName("Cut Tool").addFeature(cut); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
300 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
301 // draw diagram |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
302 this.$store.dispatch("fairwayprofile/cut", cut); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
303 } else { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
304 displayError({ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
305 title: "Invalid input", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
306 message: |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
307 "Please enter correct coordinates in the format: Lat,Lon,Lat,Lon" |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
308 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
309 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
310 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
311 saveCut() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
312 const previousCuts = |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
313 JSON.parse(localStorage.getItem("previousCuts")) || []; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
314 const newEntry = { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
315 label: this.cutLabel, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
316 bottleneckName: this.selectedBottleneck, |
1377
fa7d647f8d77
added timestamp to saved cross profiles
Markus Kottlaender <markus@intevation.de>
parents:
1372
diff
changeset
|
317 coordinates: [...this.startPoint, ...this.endPoint], |
fa7d647f8d77
added timestamp to saved cross profiles
Markus Kottlaender <markus@intevation.de>
parents:
1372
diff
changeset
|
318 timestamp: new Date().getTime() |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
319 }; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
320 const existingEntry = previousCuts.find(cut => { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
321 return JSON.stringify(cut) === JSON.stringify(newEntry); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
322 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
323 if (!existingEntry) previousCuts.push(newEntry); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
324 if (previousCuts.length > 100) previousCuts.shift(); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
325 localStorage.setItem("previousCuts", JSON.stringify(previousCuts)); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
326 this.$store.dispatch("fairwayprofile/previousCuts"); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
327 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
328 this.showLabelInput = false; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
329 this.cutLabel = ""; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
330 displayInfo({ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
331 title: "Coordinates saved!", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
332 message: |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
333 'You can now select these coordinates from the "Saved cross profiles" menu to restore this cross profile.' |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
334 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
335 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
336 moveToBottleneck() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
337 const bottleneck = this.bottlenecks.find( |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
338 bn => bn.properties.name === this.selectedBottleneck |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
339 ); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
340 if (!bottleneck) return; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
341 this.$store.commit("map/moveMap", { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
342 coordinates: bottleneck.geometry.coordinates, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
343 zoom: 17, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
344 preventZoomOut: true |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
345 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
346 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
347 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
348 }; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
349 </script> |