Mercurial > gemma
changeset 2370:7fe2f5d334dc
client: improved identify tool readability
There's now a formatter.js which can be used to format labels and values or to
remove information that is not needed.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 21 Feb 2019 14:57:04 +0100 |
parents | 89a3096e1988 |
children | 045bac575294 |
files | client/src/components/App.vue client/src/components/toolbar/Identify.vue client/src/store/map.js |
diffstat | 3 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/App.vue Thu Feb 21 14:43:45 2019 +0100 +++ b/client/src/components/App.vue Thu Feb 21 14:57:04 2019 +0100 @@ -106,7 +106,7 @@ Infobar: () => import("./fairway/Infobar"), Pdftool: () => import("./Pdftool"), Zoom: () => import("./Zoom"), - Identify: () => import("./Identify"), + Identify: () => import("./identify/Identify"), Layers: () => import("./layers/Layers"), Sidebar: () => import("./Sidebar"), Search: () => import("./Search"),
--- a/client/src/components/toolbar/Identify.vue Thu Feb 21 14:43:45 2019 +0100 +++ b/client/src/components/toolbar/Identify.vue Thu Feb 21 14:57:04 2019 +0100 @@ -12,7 +12,8 @@ 'indicator', { show: - !showIdentify && (identifiedFeatures.length || currentMeasurement) + !showIdentify && + (filteredIdentifiedFeatures.length || currentMeasurement) } ]" > @@ -35,15 +36,16 @@ * Author(s): * Markus Kottländer <markus.kottlaender@intevation.de> */ -import { mapState } from "vuex"; +import { mapState, mapGetters } from "vuex"; export default { name: "identify", computed: { ...mapState("application", ["showIdentify"]), - ...mapState("map", ["identifiedFeatures", "currentMeasurement"]), + ...mapState("map", ["currentMeasurement"]), + ...mapGetters("map", ["filteredIdentifiedFeatures"]), badgeCount() { - return this.identifiedFeatures.length + !!this.currentMeasurement; + return this.filteredIdentifiedFeatures.length + !!this.currentMeasurement; } } };
--- a/client/src/store/map.js Thu Feb 21 14:43:45 2019 +0100 +++ b/client/src/store/map.js Thu Feb 21 14:57:04 2019 +0100 @@ -482,6 +482,9 @@ }, getVSourceByName: (state, getters) => name => { return getters.getLayerByName(name).data.getSource(); + }, + filteredIdentifiedFeatures: state => { + return state.identifiedFeatures.filter(f => f.getId()); } }, mutations: {