Mercurial > gemma
changeset 3271:b74e9768231d
client: map layers: added support for vuex store in layer configuration
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 15 May 2019 14:15:45 +0200 |
parents | d7bc51fd50b0 |
children | a9d047ccf408 |
files | client/src/components/map/layers.js |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/map/layers.js Wed May 15 13:53:48 2019 +0200 +++ b/client/src/components/map/layers.js Wed May 15 14:15:45 2019 +0200 @@ -14,6 +14,7 @@ import { equalTo } from "ol/format/filter"; import { HTTP } from "@/lib/http"; import styles from "./styles"; +import store from "@/store/index"; const buildVectorLoader = ( featureRequestOptions, @@ -51,7 +52,7 @@ JSON.stringify(response.data) ); if (featurePostProcessor) { - features.map(f => featurePostProcessor(f)); + features.map(f => featurePostProcessor(f, store)); } vectorSource.addFeatures(features); }) @@ -213,8 +214,9 @@ geometryName: "area" }, source, - f => { - if (f.getId() === this.selectedStretchId) { + true, + (f, store) => { + if (f.getId() === store.state.imports.selectedStretchId) { f.set("highlighted", true); } return f;