annotate client/src/components/map/Identify.vue @ 1481:7be4e0dfa104

add the license of geonames to the info box * add licesing information of genames data source * add .po and translation files
author Fadi Abbud <fadi.abbud@intevation.de>
date Tue, 04 Dec 2018 11:32:55 +0100
parents 9b81ac91a43e
children a9594f7d44b7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
2 <div
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
3 :class="[
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
4 'box ui-element rounded bg-white text-nowrap',
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
5 { expanded: showIdentify }
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
6 ]"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
7 >
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
8 <div style="width: 20rem">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
9 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
10 <font-awesome-icon icon="info" class="mr-2"></font-awesome-icon>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
11 <translate>Identified</translate>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
12 <font-awesome-icon
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
13 icon="times"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
14 class="ml-auto text-muted"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
15 @click="$store.commit('application/showIdentify', false)"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
16 ></font-awesome-icon>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
17 </h6>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
18 <div class="d-flex flex-column features p-3 flex-grow-1 text-left">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
19 <div v-if="currentMeasurement">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
20 <b>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
21 {{ currentMeasurement.quantity }} ({{
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
22 currentMeasurement.unitSymbol
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
23 }}):
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
24 </b>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
25 <br />
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
26 <small>{{ currentMeasurement.value }}</small>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
27 </div>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
28 <div v-for="(feature, i) of identifiedFeatures" :key="feature.getId()">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
29 <div v-if="feature.getId()" :class="{ 'mt-2': i }">
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
30 <b
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
31 >{{
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
32 feature
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
33 .getId()
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
34 .replace(
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
35 /[.][^.]*$/,
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
36 ""
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
37 ) /* cut away everything from the last . to the end */
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
38 }}:</b
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
39 >
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
40 <small
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
41 v-for="(value, key) in prepareProperties(feature)"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
42 :key="key"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
43 >
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
44 <div v-if="value">{{ key }}:{{ value }}</div>
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
45 </small>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
46 </div>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
47 </div>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
48 <div
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
49 v-if="!currentMeasurement && !identifiedFeatures.length"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
50 class="text-muted small text-center my-auto"
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
51 >
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
52 <translate>No features identified.</translate>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
53 </div>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
54 </div>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
55 <div class="versioninfo border-top p-3 text-left">
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
56 <span v-translate="{ license: 'AGPL-3.0-or-later' }">
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
57 This app uses <i>gemma</i>, which is Free Software under <br />
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
58 %{ license } without warranty, see docs for details.
1460
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1449
diff changeset
59 </span>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
60 <br />
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
61 <a href="https://hg.intevation.de/gemma/file/tip">
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
62 <translate>source-code</translate>
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
63 </a>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
64 {{ versionStr }} <br />© via donau. &#x24D4; Intevation. <br />
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
65 <span v-translate="{ name: 'OpenSteetMap' }"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
66 >Some data ©
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1460
diff changeset
67 <a href="https://www.openstreetmap.org/copyright">%{ name }</a>
1481
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
68 contributors.
1460
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1449
diff changeset
69 </span>
1481
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
70 <p v-translate="{geoLicense: 'CC-BY-4.0',data: 'data sources' }">
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
71 Geonames data source is licensed under
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
72 <a
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
73 href="https://creativecommons.org/licenses/by/4.0/"
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
74 >%{ geoLicense }</a> without warranty, see docs for details
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
75 <a
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
76 href="http://www.geonames.org/data-sources.html"
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
77 >%{ data }</a>.
7be4e0dfa104 add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1480
diff changeset
78 </p>
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
79 </div>
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
80 </div>
1416
3af7ad9717e2 Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1408
diff changeset
81 </div>
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
82 </template>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
83
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
84 <style lang="scss" scoped>
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
85 .features {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
86 max-height: 19rem;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
87 overflow-y: auto;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
88 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
89
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
90 .versioninfo {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
91 font-size: 60%;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
92 white-space: normal;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1426
diff changeset
93 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
94 </style>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
95
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
96 <script>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
97 /* This is Free Software under GNU Affero General Public License v >= 3.0
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
98 * without warranty, see README.md and license for details.
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
99 *
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
100 * SPDX-License-Identifier: AGPL-3.0-or-later
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
101 * License-Filename: LICENSES/AGPL-3.0.txt
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
102 *
1408
1a7c8ea22392 client: (minor) remove trailing whitespace
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1407
diff changeset
103 * Copyright (C) 2018 by via donau
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
104 * – Österreichische Wasserstraßen-Gesellschaft mbH
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
105 * Software engineering by Intevation GmbH
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
106 *
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
107 * Author(s):
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
108 * Thomas Junk <thomas.junk@intevation.de>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
109 * Bernhard E. Reiter <bernhard.reiter@intevation.de>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
110 * Markus Kottländer <markus.kottlaender@intevation.de>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
111 */
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
112 import { mapState, mapGetters } from "vuex";
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
113
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
114 export default {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
115 name: "identify",
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
116 computed: {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
117 ...mapGetters("application", ["versionStr"]),
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
118 ...mapState("application", ["showIdentify"]),
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
119 ...mapState("map", ["identifiedFeatures", "currentMeasurement"])
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
120 },
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
121 methods: {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
122 prepareProperties(feature) {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
123 // return dict object with propertyname:plainvalue prepared for display
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
124 var properties = feature.getProperties();
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
125 delete properties[feature.getGeometryName()];
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
126 return properties;
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
127 }
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
128 }
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
129 };
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
130 </script>