# HG changeset patch # User Markus Kottlaender # Date 1550757424 -3600 # Node ID 7fe2f5d334dcf3d2bebe23e5d1f5c34c9abc1321 # Parent 89a3096e198831fdc07b9ad020a92b6ce82ebb43 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. diff -r 89a3096e1988 -r 7fe2f5d334dc client/src/components/App.vue --- 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"), diff -r 89a3096e1988 -r 7fe2f5d334dc client/src/components/toolbar/Identify.vue --- 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 */ -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; } } }; diff -r 89a3096e1988 -r 7fe2f5d334dc client/src/store/map.js --- 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: {