Mercurial > gemma
diff client/src/components/map/Map.vue @ 3021:2e2a271c1026
client: fixed layer factory to actually serve different objects
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 11 Apr 2019 18:57:40 +0200 |
parents | 083cd270bdfd |
children | c71373594719 |
line wrap: on
line diff
--- a/client/src/components/map/Map.vue Thu Apr 11 17:48:18 2019 +0200 +++ b/client/src/components/map/Map.vue Thu Apr 11 18:57:40 2019 +0200 @@ -69,6 +69,9 @@ ...mapState("bottlenecks", ["selectedSurvey"]), ...mapState("application", ["showSplitscreen", "panes", "paneMode"]), ...mapState("imports", ["selectedStretchId"]), + layers() { + return layers(); + }, hasActiveInteractions() { return ( (this.lineTool && this.lineTool.getActive()) || @@ -82,14 +85,14 @@ const exists = bottleneck_id != "does_not_exist"; if (exists) { - layers + this.layers .get("BOTTLENECKISOLINE") .getSource() .updateParams({ cql_filter: `date_info='${datestr}' AND bottleneck_id='${bottleneck_id}'` }); } - layers.get("BOTTLENECKISOLINE").setVisible(exists); + this.layers.get("BOTTLENECKISOLINE").setVisible(exists); } }, watch: { @@ -122,7 +125,7 @@ } }, selectedStretchId(id) { - layers + this.layers .get("STRETCHES") .getSource() .getFeatures() @@ -136,7 +139,7 @@ }, mounted() { this.map = new Map({ - layers: layers.config, + layers: this.layers.config, target: "map-" + this.uuid, controls: [], view: new View({ @@ -146,7 +149,7 @@ projection: "EPSG:3857" }) }); - this.map.getLayer = id => layers.get(id); + this.map.getLayer = id => this.layers.get(id); // store map position on every move // will be obsolete once we abandoned the separated admin context @@ -212,7 +215,7 @@ color: btlnFillC }) }); - layers.get("BOTTLENECKS").setStyle(newStyle); + this.layers.get("BOTTLENECKS").setStyle(newStyle); }) .catch(error => { console.log(error);