Mercurial > gemma
annotate client/src/components/fairway/Profiles.vue @ 3204:1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
...because multiple features were identified. In that case no dialog will be opened automatically but a popup with
possible options is shown.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 08 May 2019 17:10:17 +0200 |
parents | f7d7fdc58cad |
children | 5914d615f703 |
rev | line source |
---|---|
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
1480 | 2 <div |
3 :class="[ | |
4 'box ui-element rounded bg-white text-nowrap', | |
5 { expanded: showProfiles } | |
6 ]" | |
7 > | |
2260
531e776cb81d
client: reduced width of pdf-, profile- and identify-box
Markus Kottlaender <markus@intevation.de>
parents:
2154
diff
changeset
|
8 <div style="width: 18rem"> |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2740
diff
changeset
|
9 <UIBoxHeader |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2740
diff
changeset
|
10 icon="chart-area" |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2740
diff
changeset
|
11 :title="profilesLable" |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2740
diff
changeset
|
12 :closeCallback="close" |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2740
diff
changeset
|
13 /> |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
14 <div class="box-body"> |
3158
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
15 <UISpinnerOverlay v-if="surveysLoading || profileLoading" /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
16 <select |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
17 @change="moveToBottleneck" |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
18 v-model="selectedBottleneck" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
19 class="form-control font-weight-bold" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
20 > |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
21 <option :value="null"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
22 <translate>Select Bottleneck</translate> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
23 </option> |
2812
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
24 <optgroup |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
25 v-for="(bottlenecksForCountry, cc) in orderedBottlenecks" |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
26 :key="cc" |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
27 :label="cc" |
1480 | 28 > |
2812
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
29 <option |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
30 v-for="bn in bottlenecksForCountry" |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
31 :key="bn.properties.name" |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
32 :value="bn.properties.name" |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
33 > |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
34 {{ bn.properties.name }} |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
35 </option> |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
36 </optgroup> |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 </select> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 <div v-if="selectedBottleneck"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 <div class="d-flex mt-2"> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 <div class="flex-fill"> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
41 <small class="text-muted"> |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
42 <translate>Waterlevel</translate>: |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
43 </small> |
1480 | 44 <select |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
45 v-model="selectedWaterLevel" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
46 class="form-control form-control-sm small" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
47 > |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
48 <option value="" v-if="Object.keys(waterLevels).length === 0"> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
49 <translate>Current</translate> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
50 </option> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
51 <option |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
52 v-for="wl in Object.keys(waterLevels)" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
53 :key="wl" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
54 :value="wl" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
55 > |
2541
468c8dc796cf
client: convert lib helper functions to Vue filters
Markus Kottlaender <markus@intevation.de>
parents:
2540
diff
changeset
|
56 {{ wl | surveyDate }} |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
57 </option> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
58 </select> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
59 </div> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
60 <div class="flex-fill ml-2"> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
61 <small class="text-muted"> <translate>Survey</translate>: </small> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
62 <select |
1480 | 63 v-model="selectedSurvey" |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
64 class="form-control form-control-sm small" |
1480 | 65 > |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
66 <option |
1379 | 67 v-for="survey in surveys" |
68 :key="survey.date_info" | |
69 :value="survey" | |
2541
468c8dc796cf
client: convert lib helper functions to Vue filters
Markus Kottlaender <markus@intevation.de>
parents:
2540
diff
changeset
|
70 >{{ survey.date_info | surveyDate }}</option |
1480 | 71 > |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
72 </select> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
73 </div> |
1480 | 74 <div |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
75 class="flex-fill ml-2" |
1480 | 76 v-if="selectedSurvey && surveys.length > 1" |
77 > | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
78 <small class="text-muted mt-1"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
79 <translate>Compare with</translate>: |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
80 </small> |
1480 | 81 <select |
82 v-model="additionalSurvey" | |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
83 class="form-control form-control-sm small" |
1480 | 84 > |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 <option :value="null">None</option> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 <option |
1379 | 87 v-for="survey in additionalSurveys" |
88 :key="survey.date_info" | |
89 :value="survey" | |
2541
468c8dc796cf
client: convert lib helper functions to Vue filters
Markus Kottlaender <markus@intevation.de>
parents:
2540
diff
changeset
|
90 >{{ survey.date_info | surveyDate }}</option |
1480 | 91 > |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
92 </select> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
93 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
94 </div> |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
95 <div class="mt-2 d-flex" v-if="additionalSurvey"> |
2848
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
96 <button |
3158
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
97 v-if="differencesLoading" |
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
98 class="btn btn-info btn-xs flex-fill" |
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
99 disabled |
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
100 > |
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
101 <font-awesome-icon icon="spinner" spin class="mr-1" /> |
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
102 <translate>Calculating differences</translate> |
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
103 </button> |
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
104 <button |
3085
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
105 class="btn btn-info btn-xs flex-fill" |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
106 @click="differencesVisible ? showSurvey() : showDifferences()" |
3158
f91df0bc4986
client: compare surveys: prevent loading of differences from blocking the whole dialog
Markus Kottlaender <markus@intevation.de>
parents:
3146
diff
changeset
|
107 v-else |
2848
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
108 > |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
109 <translate v-if="differencesVisible" key="showsurvey" |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
110 >Show survey</translate |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
111 > |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
112 <translate v-else key="showdifferences" |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
113 >Show differences</translate |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
114 > |
2848
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
115 </button> |
3085
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
116 <button |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
117 v-if="!paneSetup.includes('FAIRWAYPROFILE')" |
3085
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
118 class="btn btn-info btn-xs ml-2" |
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
119 @click="$store.commit('application/paneRotate')" |
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
120 v-tooltip="rotatePanesTooltip" |
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
121 > |
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
122 <font-awesome-icon icon="redo" fixed-width /> |
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
123 </button> |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
124 <button |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
125 class="btn btn-info btn-xs ml-2" |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
126 @click="toggleSyncMaps()" |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
127 v-tooltip="syncMapsTooltip" |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
128 > |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
129 <font-awesome-icon |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
130 :icon="mapsAreSynced ? 'unlink' : 'link'" |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
131 fixed-width |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
132 /> |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
133 </button> |
2848
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
134 </div> |
1480 | 135 <hr class="w-100 mb-0" /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
136 <small class="text-muted d-block mt-2"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
137 <translate>Saved cross profiles</translate>: |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
138 </small> |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
139 <div class="d-flex"> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
140 <select |
1480 | 141 :class="[ |
142 'form-control form-control-sm flex-fill', | |
143 { 'rounded-left-only': selectedCut } | |
144 ]" | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
145 v-model="selectedCut" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
146 > |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
147 <option></option> |
1480 | 148 <option |
149 v-for="(cut, index) in previousCuts" | |
150 :value="cut" | |
151 :key="index" | |
152 >{{ cut.label }}</option | |
153 > | |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
154 </select> |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
155 <button |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
156 class="btn btn-sm btn-dark input-button-right" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
157 @click="deleteSelectedCut(selectedCut)" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
158 v-if="selectedCut" |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
159 > |
1480 | 160 <font-awesome-icon icon="trash" /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
161 </button> |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
162 </div> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
163 <small class="text-muted d-block mt-2"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
164 <translate>Enter coordinates manually</translate>: |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
165 </small> |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
166 <div class="position-relative"> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
167 <input |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
168 class="form-control form-control-sm pr-5" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
169 placeholder="Lat,Lon,Lat,Lon" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
170 v-model="coordinatesInput" |
1480 | 171 /> |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
172 <button |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
173 class="btn btn-sm btn-info position-absolute input-button-right" |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
174 @click="applyManualCoordinates" |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
175 style="top: 0; right: 0;" |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
176 v-if="coordinatesInputIsValid" |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
177 > |
1480 | 178 <font-awesome-icon icon="check" /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
179 </button> |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
180 </div> |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
181 <small class="d-flex text-left mt-2" v-if="startPoint && endPoint"> |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
182 <div class="text-nowrap mr-3"> |
1480 | 183 <b> <translate>Start</translate>: </b> <br /> |
184 Lat: {{ startPoint[1] }} <br /> | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
185 Lon: {{ startPoint[0] }} |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 <div class="text-nowrap"> |
1480 | 188 <b>End:</b> <br /> |
189 Lat: {{ endPoint[1] }} <br /> | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 Lon: {{ endPoint[0] }} |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
191 </div> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
192 <button |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
193 v-clipboard:copy="coordinatesForClipboard" |
1379 | 194 v-clipboard:success="onCopyCoordinates" |
195 class="btn btn-info btn-sm ml-auto mt-auto" | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
196 > |
1480 | 197 <font-awesome-icon icon="copy" /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
198 </button> |
1379 | 199 </small> |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
200 <div class="d-flex mt-3"> |
1480 | 201 <div |
202 class="pr-3 w-50" | |
203 v-if="startPoint && endPoint && !selectedCut" | |
204 > | |
205 <button | |
206 class="btn btn-info btn-sm w-100" | |
207 @click="showLabelInput = !showLabelInput" | |
208 > | |
209 <font-awesome-icon :icon="showLabelInput ? 'times' : 'check'" /> | |
1379 | 210 {{ showLabelInput ? "Cancel" : "Save" }} |
211 </button> | |
212 </div> | |
1480 | 213 <div |
214 :class="startPoint && endPoint && !selectedCut ? 'w-50' : 'w-100'" | |
215 > | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
216 <button class="btn btn-info btn-sm w-100" @click="toggleCutTool"> |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
217 <font-awesome-icon :icon="cutToolEnabled ? 'times' : 'plus'" /> |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
218 {{ cutToolEnabled ? "Cancel" : "New" }} |
1379 | 219 </button> |
220 </div> | |
221 </div> | |
222 <div v-if="showLabelInput" class="mt-2"> | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
223 <small class="text-muted"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
224 <translate>Enter label for cross profile</translate>: |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
225 </small> |
1379 | 226 <div class="position-relative"> |
1480 | 227 <input |
228 class="form-control form-control-sm pr-5" | |
229 v-model="cutLabel" | |
230 /> | |
1379 | 231 <button |
232 class="btn btn-sm btn-info position-absolute input-button-right" | |
233 @click="saveCut" | |
234 v-if="cutLabel" | |
235 style="top: 0; right: 0;" | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
236 > |
1480 | 237 <font-awesome-icon icon="check" /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
238 </button> |
1379 | 239 </div> |
240 </div> | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
241 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
242 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
243 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
244 </div> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
245 </template> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
246 |
1449 | 247 <style lang="scss" scoped> |
248 .input-button-right { | |
249 border-top-right-radius: $border-radius; | |
250 border-bottom-right-radius: $border-radius; | |
251 border-top-left-radius: 0 !important; | |
252 border-bottom-left-radius: 0 !important; | |
253 } | |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
254 |
1449 | 255 .rounded-left-only { |
256 border-top-right-radius: 0 !important; | |
257 border-bottom-right-radius: 0 !important; | |
258 border-top-left-radius: $border-radius; | |
259 border-bottom-left-radius: $border-radius; | |
260 } | |
3200 | 261 |
262 input, | |
263 select { | |
264 font-size: 0.8em; | |
265 } | |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
266 </style> |
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 <script> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
269 /* 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
|
270 * without warranty, see README.md and license for details. |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
271 * |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
272 * SPDX-License-Identifier: AGPL-3.0-or-later |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 * License-Filename: LICENSES/AGPL-3.0.txt |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
274 * |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1399
diff
changeset
|
275 * Copyright (C) 2018 by via donau |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
276 * – Österreichische Wasserstraßen-Gesellschaft mbH |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
277 * Software engineering by Intevation GmbH |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 * |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
279 * Author(s): |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
280 * Markus Kottländer <markus.kottlaender@intevation.de> |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
281 */ |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
282 import { mapState, mapGetters } from "vuex"; |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
283 import Feature from "ol/Feature"; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
284 import LineString from "ol/geom/LineString"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
285 import { displayError, displayInfo } from "@/lib/errors"; |
2848
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
286 import { HTTP } from "@/lib/http"; |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
287 import { COMPARESURVEYS } from "@/components/paneSetups"; |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
288 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
289 export default { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
290 name: "profiles", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
291 data() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
292 return { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
293 coordinatesInput: "", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
294 cutLabel: "", |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
295 showLabelInput: false |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
296 }; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
297 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
298 computed: { |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
299 ...mapState("application", ["showProfiles", "paneSetup"]), |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
300 ...mapState("map", ["openLayersMaps", "syncedMaps", "cutToolEnabled"]), |
2436
64ff5984351e
client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents:
2435
diff
changeset
|
301 ...mapState("bottlenecks", [ |
64ff5984351e
client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents:
2435
diff
changeset
|
302 "bottlenecksList", |
64ff5984351e
client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents:
2435
diff
changeset
|
303 "surveys", |
64ff5984351e
client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents:
2435
diff
changeset
|
304 "surveysLoading" |
64ff5984351e
client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents:
2435
diff
changeset
|
305 ]), |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
306 ...mapState("fairwayprofile", [ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
307 "previousCuts", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
308 "startPoint", |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
309 "endPoint", |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
310 "profileLoading", |
2851
a7e31594959d
profiles: difference selection now with spinner
Thomas Junk <thomas.junk@intevation.de>
parents:
2848
diff
changeset
|
311 "differencesLoading", |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
312 "waterLevels", |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
313 "currentProfile" |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
314 ]), |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
315 ...mapGetters("map", ["openLayersMap"]), |
2812
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
316 orderedBottlenecks() { |
2844
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
317 let groupedBottlenecks = {}, |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
318 orderedGroups = {}; |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
319 |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
320 // group bottlenecks by cc |
2812
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
321 this.bottlenecksList.forEach(bn => { |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
322 let cc = bn.properties.responsible_country; |
2844
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
323 if (groupedBottlenecks.hasOwnProperty(cc)) { |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
324 groupedBottlenecks[cc].push(bn); |
2812
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
325 } else { |
2844
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
326 groupedBottlenecks[cc] = [bn]; |
2812
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
327 } |
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
328 }); |
2844
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
329 |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
330 // order groups by cc |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
331 Object.keys(groupedBottlenecks) |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
332 .sort() |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
333 .forEach(cc => (orderedGroups[cc] = groupedBottlenecks[cc])); |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
334 |
77cef49d93ca
client: profiles: bottleneck list sorted by country
Markus Kottlaender <markus@intevation.de>
parents:
2840
diff
changeset
|
335 return orderedGroups; |
2812
30a753f51a3c
client: profiles: ordered bottleneck list by country code
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
336 }, |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2740
diff
changeset
|
337 profilesLable() { |
3172
975efa874acf
statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
3158
diff
changeset
|
338 return this.$gettext("Bottleneck"); |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2740
diff
changeset
|
339 }, |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
340 selectedBottleneck: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
341 get() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
342 return this.$store.state.bottlenecks.selectedBottleneck; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
343 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
344 set(name) { |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3200
diff
changeset
|
345 this.$store.dispatch("bottlenecks/setSelectedBottleneck", name); |
1372
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 }, |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
348 selectedWaterLevel: { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
349 get() { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
350 return this.$store.state.fairwayprofile.selectedWaterLevel.date || ""; |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
351 }, |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
352 set(value) { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
353 this.$store.commit("fairwayprofile/setSelectedWaterLevel", value); |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
354 } |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
355 }, |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
356 selectedSurvey: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
357 get() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
358 return this.$store.state.bottlenecks.selectedSurvey; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
359 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
360 set(survey) { |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
361 this.$store.commit("fairwayprofile/additionalSurvey", null); |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
362 this.$store.commit("bottlenecks/selectedSurvey", survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
363 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
364 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
365 additionalSurvey: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
366 get() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
367 return this.$store.state.fairwayprofile.additionalSurvey; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
368 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
369 set(survey) { |
1391
801ae5f4bc5b
fixed bug when changing additional survey in profile dialog
Markus Kottlaender <markus@intevation.de>
parents:
1382
diff
changeset
|
370 this.$store.commit("fairwayprofile/additionalSurvey", survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
371 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
372 }, |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
373 selectedCut: { |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
374 get() { |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
375 return this.$store.state.fairwayprofile.selectedCut; |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
376 }, |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
377 set(cut) { |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
378 this.$store.commit("fairwayprofile/selectedCut", cut); |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
379 if (!cut) { |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
380 this.$store.commit("fairwayprofile/clearCurrentProfile"); |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
381 this.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
382 m.getLayer("CUTTOOL") |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
383 .getSource() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
384 .clear(); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
385 }); |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
386 } |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
387 } |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
388 }, |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
389 additionalSurveys() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
390 return this.surveys.filter(survey => survey !== this.selectedSurvey); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
391 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
392 coordinatesForClipboard() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
393 return ( |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
394 this.startPoint[1] + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
395 "," + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
396 this.startPoint[0] + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
397 "," + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
398 this.endPoint[1] + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
399 "," + |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
400 this.endPoint[0] |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
401 ); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
402 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
403 coordinatesInputIsValid() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
404 const coordinates = this.coordinatesInput |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
405 .split(",") |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
406 .map(coord => parseFloat(coord.trim())) |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
407 .filter(c => Number(c) === c); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
408 return coordinates.length === 4; |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
409 }, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
410 differencesVisible() { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
411 return ( |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
412 this.openLayersMap(COMPARESURVEYS.compare.id) && |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
413 !this.openLayersMap(COMPARESURVEYS.compare.id) |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
414 .getLayer("BOTTLENECKISOLINE") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
415 .getVisible() && |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
416 this.openLayersMap(COMPARESURVEYS.compare.id) |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
417 .getLayer("DIFFERENCES") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
418 .getVisible() |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
419 ); |
3085
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
420 }, |
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
421 rotatePanesTooltip() { |
7ac392edf8e2
client: added pane rotate button to profile dialog when second map is displayed
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
422 return this.$gettext("Rotate Maps"); |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
423 }, |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
424 syncMapsTooltip() { |
3120
a77d0eafeccc
client: compare surveys: changing label of button to sync maps depending on whether maps are synced or not
Markus Kottlaender <markus@intevation.de>
parents:
3086
diff
changeset
|
425 return this.$gettext( |
a77d0eafeccc
client: compare surveys: changing label of button to sync maps depending on whether maps are synced or not
Markus Kottlaender <markus@intevation.de>
parents:
3086
diff
changeset
|
426 this.mapsAreSynced ? "Unsynchronize Maps" : "Synchronize Maps" |
a77d0eafeccc
client: compare surveys: changing label of button to sync maps depending on whether maps are synced or not
Markus Kottlaender <markus@intevation.de>
parents:
3086
diff
changeset
|
427 ); |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
428 }, |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
429 mapsAreSynced() { |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
430 return this.syncedMaps.includes(COMPARESURVEYS.compare.id); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
431 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
432 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
433 watch: { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
434 selectedBottleneck() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
435 this.$store.dispatch("fairwayprofile/previousCuts"); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
436 this.cutLabel = |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
437 this.selectedBottleneck + " (" + new Date().toISOString() + ")"; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
438 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
439 selectedSurvey(survey) { |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
440 this.loadProfile(survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
441 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
442 additionalSurvey(survey) { |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
443 if (survey) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
444 this.loadDifferences(); |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
445 this.$store.commit( |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
446 "application/paneSetup", |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
447 Object.keys(this.currentProfile).length |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
448 ? "COMPARESURVEYS_FAIRWAYPROFILE" |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
449 : "COMPARESURVEYS" |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
450 ); |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
451 this.$store.commit("map/syncedMaps", [COMPARESURVEYS.compare.id]); |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
452 } else { |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
453 this.$store.commit( |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
454 "application/paneSetup", |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
455 Object.keys(this.currentProfile).length ? "FAIRWAYPROFILE" : "DEFAULT" |
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
456 ); |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
457 this.$store.commit("map/syncedMaps", []); |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
458 } |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
459 this.loadProfile(survey); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
460 }, |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
461 selectedCut(cut) { |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
462 if (cut) { |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
463 this.applyCoordinates(cut.coordinates); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
464 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
465 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
466 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
467 methods: { |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
468 toggleSyncMaps() { |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
469 if (this.mapsAreSynced) { |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
470 this.$store.commit( |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
471 "map/syncedMaps", |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
472 this.syncedMaps.filter(m => m !== COMPARESURVEYS.compare.id) |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
473 ); |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
474 } else { |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
475 this.$store.commit("map/syncedMaps", [COMPARESURVEYS.compare.id]); |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
476 } |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3085
diff
changeset
|
477 }, |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
478 loadDifferences() { |
2851
a7e31594959d
profiles: difference selection now with spinner
Thomas Junk <thomas.junk@intevation.de>
parents:
2848
diff
changeset
|
479 this.$store.commit("fairwayprofile/setDifferencesLoading", true); |
2848
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
480 HTTP.post( |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
481 "/diff", |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
482 { |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
483 bottleneck: this.selectedSurvey.bottleneck_id, |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
484 minuend: this.selectedSurvey.date_info, |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
485 subtrahend: this.additionalSurvey.date_info |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
486 }, |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
487 { |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
488 headers: { |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
489 "X-Gemma-Auth": localStorage.getItem("token") |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
490 } |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
491 } |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
492 ) |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
493 .catch(error => { |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
494 const { status, data } = error.response; |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
495 displayError({ |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
496 title: this.$gettext("Backend Error"), |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
497 message: `${status}: ${data.message || data}` |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
498 }); |
2851
a7e31594959d
profiles: difference selection now with spinner
Thomas Junk <thomas.junk@intevation.de>
parents:
2848
diff
changeset
|
499 }) |
a7e31594959d
profiles: difference selection now with spinner
Thomas Junk <thomas.junk@intevation.de>
parents:
2848
diff
changeset
|
500 .finally(() => { |
a7e31594959d
profiles: difference selection now with spinner
Thomas Junk <thomas.junk@intevation.de>
parents:
2848
diff
changeset
|
501 this.$store.commit("fairwayprofile/setDifferencesLoading", false); |
2848
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
502 }); |
b6886706b325
profiles: display sounding_differences
Thomas Junk <thomas.junk@intevation.de>
parents:
2844
diff
changeset
|
503 }, |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
504 showDifferences() { |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
505 this.openLayersMap(COMPARESURVEYS.compare.id) |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
506 .getLayer("BOTTLENECKISOLINE") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
507 .setVisible(false); |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
508 this.openLayersMap(COMPARESURVEYS.compare.id) |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
509 .getLayer("DIFFERENCES") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
510 .setVisible(true); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
511 }, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
512 showSurvey() { |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
513 this.openLayersMap(COMPARESURVEYS.compare.id) |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
514 .getLayer("BOTTLENECKISOLINE") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
515 .setVisible(true); |
3146
b6cc4838d2c0
client: implemented pane mechanic for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3121
diff
changeset
|
516 this.openLayersMap(COMPARESURVEYS.compare.id) |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
517 .getLayer("DIFFERENCES") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
518 .setVisible(false); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
519 }, |
2387
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2365
diff
changeset
|
520 close() { |
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2365
diff
changeset
|
521 this.$store.commit("application/showProfiles", false); |
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2365
diff
changeset
|
522 }, |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
523 loadProfile(survey) { |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
524 if (survey) { |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
525 this.$store.commit("fairwayprofile/profileLoading", true); |
1399
8e2c9e518440
improved search style
Markus Kottlaender <markus@intevation.de>
parents:
1396
diff
changeset
|
526 this.$store |
8e2c9e518440
improved search style
Markus Kottlaender <markus@intevation.de>
parents:
1396
diff
changeset
|
527 .dispatch("fairwayprofile/loadProfile", survey) |
2550
dc42faf90e1d
client: profiles: trigger splitscreen loading animation when changing compare survey
Markus Kottlaender <markus@intevation.de>
parents:
2541
diff
changeset
|
528 .finally(() => { |
dc42faf90e1d
client: profiles: trigger splitscreen loading animation when changing compare survey
Markus Kottlaender <markus@intevation.de>
parents:
2541
diff
changeset
|
529 this.$store.commit("fairwayprofile/profileLoading", false); |
dc42faf90e1d
client: profiles: trigger splitscreen loading animation when changing compare survey
Markus Kottlaender <markus@intevation.de>
parents:
2541
diff
changeset
|
530 }); |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
531 } |
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1391
diff
changeset
|
532 }, |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
533 toggleCutTool() { |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
534 this.$store.commit("map/cutToolEnabled", !this.cutToolEnabled); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
535 this.$store.commit("map/lineToolEnabled", false); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
536 this.$store.commit("map/polygonToolEnabled", false); |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
537 this.$store.commit("map/setCurrentMeasurement", null); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
538 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
539 onCopyCoordinates() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
540 displayInfo({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1437
diff
changeset
|
541 message: this.$gettext("Coordinates copied to clipboard!") |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
542 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
543 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
544 applyManualCoordinates() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
545 const coordinates = this.coordinatesInput |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
546 .split(",") |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
547 .map(coord => parseFloat(coord.trim())); |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
548 this.selectedCut = null; |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
549 this.coordinatesInput = ""; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
550 this.applyCoordinates([ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
551 coordinates[1], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
552 coordinates[0], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
553 coordinates[3], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
554 coordinates[2] |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
555 ]); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
556 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
557 applyCoordinates(coordinates) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
558 // allow only numbers |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
559 coordinates = coordinates.filter(c => Number(c) === c); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
560 if (coordinates.length === 4) { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
561 // draw line on map |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
562 this.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
563 m.getLayer("CUTTOOL") |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
564 .getSource() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
565 .clear(); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
566 }); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
567 const cut = new Feature({ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
568 geometry: new LineString([ |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
569 [coordinates[0], coordinates[1]], |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
570 [coordinates[2], coordinates[3]] |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
571 ]).transform("EPSG:4326", "EPSG:3857") |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
572 }); |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
573 this.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
574 m.getLayer("CUTTOOL") |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
575 .getSource() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
576 .addFeature(cut); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
577 }); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
578 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
579 // draw diagram |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
580 this.$store.dispatch("fairwayprofile/cut", cut); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
581 } else { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
582 displayError({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1437
diff
changeset
|
583 title: this.$gettext("Invalid input"), |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1437
diff
changeset
|
584 message: this.$gettext( |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
585 "Please enter correct coordinates in the format: Lat,Lon,Lat,Lon" |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1437
diff
changeset
|
586 ) |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
587 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
588 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
589 }, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
590 saveCut() { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
591 const previousCuts = |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
592 JSON.parse(localStorage.getItem("previousCuts")) || []; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
593 const newEntry = { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
594 label: this.cutLabel, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
595 bottleneckName: this.selectedBottleneck, |
1377
fa7d647f8d77
added timestamp to saved cross profiles
Markus Kottlaender <markus@intevation.de>
parents:
1372
diff
changeset
|
596 coordinates: [...this.startPoint, ...this.endPoint], |
fa7d647f8d77
added timestamp to saved cross profiles
Markus Kottlaender <markus@intevation.de>
parents:
1372
diff
changeset
|
597 timestamp: new Date().getTime() |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
598 }; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
599 const existingEntry = previousCuts.find(cut => { |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
600 return JSON.stringify(cut) === JSON.stringify(newEntry); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
601 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
602 if (!existingEntry) previousCuts.push(newEntry); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
603 if (previousCuts.length > 100) previousCuts.shift(); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
604 localStorage.setItem("previousCuts", JSON.stringify(previousCuts)); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
605 this.$store.dispatch("fairwayprofile/previousCuts"); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
606 |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
607 this.showLabelInput = false; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
608 displayInfo({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1437
diff
changeset
|
609 title: this.$gettext("Profile saved!"), |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1437
diff
changeset
|
610 message: this.$gettext( |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
611 'You can now select these coordinates from the "Saved cross profiles" menu to restore this cross profile.' |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1437
diff
changeset
|
612 ) |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
613 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
614 }, |
2540
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
615 deleteSelectedCut(cut) { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
616 this.$store.commit("application/popup", { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
617 icon: "trash", |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
618 title: this.$gettext("Delete cross profile"), |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
619 content: |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
620 this.$gettext("Do you really want to delete the cross profile:") + |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
621 `<br> |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
622 <b>${cut.label}</b>`, |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
623 confirm: { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
624 label: this.$gettext("Delete"), |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
625 icon: "trash", |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
626 callback: () => { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
627 let previousCuts = |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
628 JSON.parse(localStorage.getItem("previousCuts")) || []; |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
629 previousCuts = previousCuts.filter(cut => { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
630 return JSON.stringify(cut) !== JSON.stringify(this.selectedCut); |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
631 }); |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
632 localStorage.setItem("previousCuts", JSON.stringify(previousCuts)); |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
633 this.$store.commit("fairwayprofile/selectedCut", null); |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
634 this.$store.dispatch("fairwayprofile/previousCuts"); |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
635 displayInfo({ title: this.$gettext("Profile deleted!") }); |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
636 } |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
637 }, |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
638 cancel: { |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
639 label: this.$gettext("Cancel"), |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
640 icon: "times" |
3c17d401fbd4
client: cross profiles: moved waterlevel select to Profiles dialog
Markus Kottlaender <markus@intevation.de>
parents:
2534
diff
changeset
|
641 } |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
642 }); |
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
643 }, |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
644 moveToBottleneck() { |
2436
64ff5984351e
client: renamed store property
Markus Kottlaender <markus@intevation.de>
parents:
2435
diff
changeset
|
645 const bottleneck = this.bottlenecksList.find( |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
646 bn => bn.properties.name === this.selectedBottleneck |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
647 ); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
648 if (!bottleneck) return; |
3054
1ef2f4179d30
client: map store: merged/renamed method(s)
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
649 this.$store.dispatch("map/moveToFeauture", { |
2136
3138d60dd1a6
moveToExtent substitutes moveMap where easy doable
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
650 feature: bottleneck, |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
651 zoom: 17, |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
652 preventZoomOut: true |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
653 }); |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
654 } |
2434
817b3d726b43
client: loadBottlenecks (bottleneck_overview) only where needed
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
655 }, |
817b3d726b43
client: loadBottlenecks (bottleneck_overview) only where needed
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
656 mounted() { |
2435
3679d604645e
client: renamed store action
Markus Kottlaender <markus@intevation.de>
parents:
2434
diff
changeset
|
657 this.$store.dispatch("bottlenecks/loadBottlenecksList"); |
1372
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
658 } |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
659 }; |
553aadd97087
new cross profile workflow (WIP)
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
660 </script> |