annotate client/src/layers/Identify.vue @ 908:21ab63347a6c

open identify only with data
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 02 Oct 2018 17:08:40 +0200
parents 074ce4891466
children 86278692c30c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
1 <template>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
2 <div class="identifymenu">
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
3 <div @click="collapse" class="d-flex flex-column ui-element minimizer">
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
4 <div>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
5 <i class="fa fa-info"></i>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
6 </div>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
7 </div>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
8 <div :class="identifyStyle">
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
9 <div v-if="!collapsed" class="card-body">
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
10 <div class="headline">
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
11 <h4 class="card-title">Identified</h4>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
12 </div>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
13 <hr>
884
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
14 <div class="d-flex flex-column features">
798
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
15 <div v-for="feature of identifiedFeatures" :key="feature.getId()">
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
16 <div v-if="feature.getId()">
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
17 {{ feature.getId().replace(/[.][^.]*$/,"") /* cut away everything from the last . to the end */}}:
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
18 <small v-for="(value, key) in prepareProperties(feature)" :key="key">
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
19 <div v-if="value">{{key}}:{{value}}</div>
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
20 </small>
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
21 </div>
793
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 785
diff changeset
22 </div>
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
23 </div>
806
5ef542130865 client: add info section
Bernhard Reiter <bernhard@intevation.de>
parents: 798
diff changeset
24 <div class="versioninfo">
884
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
25 <hr/>
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
26 gemma <a href="https://hg.intevation.de/gemma/file/tip">source-code</a>
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
27 <br/>
806
5ef542130865 client: add info section
Bernhard Reiter <bernhard@intevation.de>
parents: 798
diff changeset
28 Some data ©
884
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
29 <a href="https://www.openstreetmap.org/copyright">OpenSteetMap</a> contributors
806
5ef542130865 client: add info section
Bernhard Reiter <bernhard@intevation.de>
parents: 798
diff changeset
30
5ef542130865 client: add info section
Bernhard Reiter <bernhard@intevation.de>
parents: 798
diff changeset
31 </div>
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
32 </div>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
33 </div>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
34 </div>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
35 </template>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
36
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
37 <style lang="scss">
884
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
38 .features {
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
39 height: $identify-height;
891
074ce4891466 fix: selection of profile data only when not in draw mode
Thomas Junk <thomas.junk@intevation.de>
parents: 884
diff changeset
40 overflow-y: auto;
884
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
41 margin-bottom: $x-large-offset + $large-offset;
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
42 }
806
5ef542130865 client: add info section
Bernhard Reiter <bernhard@intevation.de>
parents: 798
diff changeset
43 .versioninfo {
816
cd79f62794dd client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents: 806
diff changeset
44 font-size: 60%;
884
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
45 position: absolute;
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
46 bottom: $large-offset;
806
5ef542130865 client: add info section
Bernhard Reiter <bernhard@intevation.de>
parents: 798
diff changeset
47 }
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
48 .identifymenu {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
49 position: relative;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
50 margin-right: $offset;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
51 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
52 .identify {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
53 background-color: white;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
54 margin-left: $small-offset;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
55 opacity: $slight-transparent;
798
383fac3e5d1e Fairway profile WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 793
diff changeset
56 text-align: left;
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
57 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
58
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
59 .identifycollapsed {
884
616418a6adde fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 816
diff changeset
60 min-height: $icon-height;
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
61 width: $icon-width;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
62 transition: $transition-fast;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
63 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
64
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
65 .identifyexpanded {
771
6d214b3bed35 client: improve identify box' dynamic sizing
Bernhard Reiter <bernhard@intevation.de>
parents: 770
diff changeset
66 min-height: $identify-height;
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
67 width: $identify-width;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
68 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
69
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
70 .minimizer {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
71 position: absolute;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
72 z-index: 2;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
73 right: 0;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
74 margin-top: $x-small-offset;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
75 border-radius: $border-radius;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
76 height: $icon-width;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
77 width: $icon-height;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
78 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
79 </style>
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
80
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
81 <script>
782
cb6dc630c702 client: improve identify code
Bernhard Reiter <bernhard@intevation.de>
parents: 771
diff changeset
82 import { mapState } from "vuex";
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
83
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
84 export default {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
85 name: "identify",
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
86 data() {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
87 return {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
88 collapsed: true
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
89 };
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
90 },
908
21ab63347a6c open identify only with data
Thomas Junk <thomas.junk@intevation.de>
parents: 891
diff changeset
91 watch: {
21ab63347a6c open identify only with data
Thomas Junk <thomas.junk@intevation.de>
parents: 891
diff changeset
92 identifiedFeatures() {
21ab63347a6c open identify only with data
Thomas Junk <thomas.junk@intevation.de>
parents: 891
diff changeset
93 this.collapsed = !this.identifiedFeatures;
21ab63347a6c open identify only with data
Thomas Junk <thomas.junk@intevation.de>
parents: 891
diff changeset
94 }
21ab63347a6c open identify only with data
Thomas Junk <thomas.junk@intevation.de>
parents: 891
diff changeset
95 },
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
96 computed: {
785
1d8ccdb532de client: remove code warning (minor)
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
97 ...mapState("mapstore", ["identifiedFeatures"]),
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
98 identifyStyle() {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
99 return {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
100 "ui-element": true,
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
101 card: true,
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
102 identify: true,
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
103 shadow: true,
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
104 identifyexpanded: !this.collapsed,
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
105 identifycollapsed: this.collapsed
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
106 };
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
107 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
108 },
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
109 methods: {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
110 collapse() {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
111 this.collapsed = !this.collapsed;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
112 },
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
113 prepareProperties(feature) {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
114 // return dict object with propertyname:plainvalue prepared for display
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
115 var properties = feature.getProperties();
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
116 delete properties[feature.getGeometryName()];
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
117 return properties;
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
118 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
119 }
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
120 };
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
121 </script>