Mercurial > gemma
annotate client/src/layers/Identify.vue @ 884:616418a6adde
fix: overflow behaviour of identify menu fixed
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 01 Oct 2018 17:07:37 +0200 |
parents | cd79f62794dd |
children | 074ce4891466 |
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; |
616418a6adde
fix: overflow behaviour of identify menu fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
816
diff
changeset
|
40 overflow-y: scroll; |
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 }, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
91 computed: { |
785
1d8ccdb532de
client: remove code warning (minor)
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
92 ...mapState("mapstore", ["identifiedFeatures"]), |
770
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
93 identifyStyle() { |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
94 return { |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
95 "ui-element": true, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
96 card: true, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
97 identify: true, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
98 shadow: true, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
99 identifyexpanded: !this.collapsed, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
100 identifycollapsed: this.collapsed |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
101 }; |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
102 } |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
103 }, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
104 methods: { |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
105 collapse() { |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
106 this.collapsed = !this.collapsed; |
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 prepareProperties(feature) { |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
109 // 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
|
110 var properties = feature.getProperties(); |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
111 delete properties[feature.getGeometryName()]; |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
112 return properties; |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
113 } |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
114 } |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
115 }; |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
diff
changeset
|
116 </script> |