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