annotate client/src/components/fairway/Profiles.vue @ 3527:8a9ee18de13f waterlevel-in-crossprofile

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