comparison client/src/components/map/Identify.vue @ 1272:bc55ffaeb639

cleaned up client/src directory better organization of files and directories, better naming, separation of admin and map context
author Markus Kottlaender <markus@intevation.de>
date Thu, 22 Nov 2018 07:07:12 +0100
parents
children dc3fb8ad8f86
comparison
equal deleted inserted replaced
1268:aca692e73028 1272:bc55ffaeb639
1 <template>
2 <div :class="['box ui-element rounded bg-white mb-auto text-nowrap', { expanded: showIdentify }]">
3 <div style="width: 20rem">
4 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center bg-info text-white">
5 <i class="fa fa-info mr-2"></i>
6 Identified
7 <i class="fa fa-times ml-auto" @click="$store.commit('application/showIdentify', false)"></i>
8 </h6>
9 <div class="d-flex flex-column features p-3 flex-grow-1 text-left">
10 <div v-if="currentMeasurement">
11 <b>
12 {{ currentMeasurement.quantity }}
13 ({{ currentMeasurement.unitSymbol }}):
14 </b><br>
15 <small>{{ currentMeasurement.value }}</small>
16 </div>
17 <div v-for="(feature, i) of identifiedFeatures" :key="feature.getId()" >
18 <div v-if="feature.getId()" :class="{ 'mt-2': i }">
19 <b>{{ feature.getId().replace(/[.][^.]*$/,"") /* cut away everything from the last . to the end */}}:</b>
20 <small
21 v-for="(value, key) in prepareProperties(feature)"
22 :key="key"
23 >
24 <div v-if="value">{{key}}:{{value}}</div>
25 </small>
26 </div>
27 </div>
28 <div v-if="!currentMeasurement && !identifiedFeatures.length" class="text-muted small text-center my-auto">
29 No features identified.
30 </div>
31 </div>
32 <div class="versioninfo border-top p-3 text-left">
33 gemma
34 <a href="https://hg.intevation.de/gemma/file/tip">source-code</a>
35 {{ versionStr }}
36 <br>Some data ©
37 <a href="https://www.openstreetmap.org/copyright">OpenSteetMap</a>contributors
38 </div>
39 </div>
40 </div>
41 </template>
42
43 <style lang="sass" scoped>
44 .features
45 max-height: 19rem
46 overflow-y: auto
47
48 .versioninfo
49 font-size: 60%
50 </style>
51
52 <script>
53 /* This is Free Software under GNU Affero General Public License v >= 3.0
54 * without warranty, see README.md and license for details.
55 *
56 * SPDX-License-Identifier: AGPL-3.0-or-later
57 * License-Filename: LICENSES/AGPL-3.0.txt
58 *
59 * Copyright (C) 2018 by via donau
60 * – Österreichische Wasserstraßen-Gesellschaft mbH
61 * Software engineering by Intevation GmbH
62 *
63 * Author(s):
64 * Thomas Junk <thomas.junk@intevation.de>
65 * Bernhard E. Reiter <bernhard.reiter@intevation.de>
66 * Markus Kottländer <markus.kottlaender@intevation.de>
67 */
68 import { mapState, mapGetters } from "vuex";
69
70 export default {
71 name: "identify",
72 computed: {
73 ...mapGetters("application", ["versionStr"]),
74 ...mapState("application", ["showIdentify"]),
75 ...mapState("map", ["identifiedFeatures", "currentMeasurement"])
76 },
77 methods: {
78 prepareProperties(feature) {
79 // return dict object with propertyname:plainvalue prepared for display
80 var properties = feature.getProperties();
81 delete properties[feature.getGeometryName()];
82 return properties;
83 }
84 }
85 };
86 </script>