Mercurial > gemma
annotate client/src/components/importoverview/StretchDetails.vue @ 3513:ca9590be1da2 waterlevel-in-crossprofile
client: fairway profiles: removed more code
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 28 May 2019 18:40:02 +0200 |
parents | 8d6e70a9ffcb |
children | b0c655e605ee |
rev | line source |
---|---|
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
2 <div> |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
3 <a @click="zoomToStretch()" class="text-info pointer">{{ |
2685
39a05f8c34e6
import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
4 details.summary.stretch |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
5 }}</a> |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
6 </div> |
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
7 </template> |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
9 <script> |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
10 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
11 * without warranty, see README.md and license for details. |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
12 * |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
13 * SPDX-License-Identifier: AGPL-3.0-or-later |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
14 * License-Filename: LICENSES/AGPL-3.0.txt |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
15 * |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
16 * Copyright (C) 2018 by via donau |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 * – Österreichische Wasserstraßen-Gesellschaft mbH |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 * Software engineering by Intevation GmbH |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
19 * |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
20 * Author(s): |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
21 * Thomas Junk <thomas.junk@intevation.de> |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
22 */ |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
23 import { displayError } from "@/lib/errors"; |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3017
diff
changeset
|
24 import { mapState, mapGetters } from "vuex"; |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
25 |
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 export default { |
2732
0ab7985ef008
import_review: fixed flakey display of logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
27 props: ["entry"], |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2685
diff
changeset
|
28 mounted() { |
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2685
diff
changeset
|
29 this.$store.commit("imports/hideAdditionalInfo"); |
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2685
diff
changeset
|
30 }, |
2732
0ab7985ef008
import_review: fixed flakey display of logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
31 computed: { |
2957
b74ebeb2bdc8
client: layers: improved structure of layer configuration
Markus Kottlaender <markus@intevation.de>
parents:
2927
diff
changeset
|
32 ...mapState("imports", ["showAdditional", "details"]), |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3017
diff
changeset
|
33 ...mapGetters("map", ["openLayersMap"]) |
2732
0ab7985ef008
import_review: fixed flakey display of logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
34 }, |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
35 methods: { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
36 zoomToStretch() { |
2685
39a05f8c34e6
import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
37 const name = this.details.summary.stretch; |
3127
0374197c384f
client: fix openLayersMap getter calls
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
38 this.openLayersMap() |
0374197c384f
client: fix openLayersMap getter calls
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
39 .getLayer("STRETCHES") |
0374197c384f
client: fix openLayersMap getter calls
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
40 .setVisible(true); |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
41 this.$store |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
42 .dispatch("imports/loadStretch", name) |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
43 .then(response => { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
44 if (response.data.features.length < 1) |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
45 throw new Error("no feaures found for: " + name); |
3356
37c024dd435e
client: import review: set selected stretch when clicking on stretch name in import details
Markus Kottlaender <markus@intevation.de>
parents:
3127
diff
changeset
|
46 this.$store.commit( |
37c024dd435e
client: import review: set selected stretch when clicking on stretch name in import details
Markus Kottlaender <markus@intevation.de>
parents:
3127
diff
changeset
|
47 "imports/selectedStretchId", |
37c024dd435e
client: import review: set selected stretch when clicking on stretch name in import details
Markus Kottlaender <markus@intevation.de>
parents:
3127
diff
changeset
|
48 response.data.features[0].id |
37c024dd435e
client: import review: set selected stretch when clicking on stretch name in import details
Markus Kottlaender <markus@intevation.de>
parents:
3127
diff
changeset
|
49 ); |
3054
1ef2f4179d30
client: map store: merged/renamed method(s)
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
50 this.$store.dispatch("map/moveToFeauture", { |
3017
9a408a8b74b8
client: inlined some functions that were used only once
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
51 feature: response.data.features[0], |
9a408a8b74b8
client: inlined some functions that were used only once
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
52 zoom: 17, |
9a408a8b74b8
client: inlined some functions that were used only once
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
53 preventZoomOut: true |
9a408a8b74b8
client: inlined some functions that were used only once
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
54 }); |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
55 }) |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
56 .catch(error => { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
57 console.log(error); |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
58 const { status, data } = error.response; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
59 displayError({ |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
60 title: this.$gettext("Backend Error"), |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
61 message: `${status}: ${data.message || data}` |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
62 }); |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
63 }); |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
64 } |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
65 } |
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 }; |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
67 </script> |