# HG changeset patch # User Markus Kottlaender # Date 1560861576 -7200 # Node ID 8775bea8042af6e3574ea8d77007db28f51437cc # Parent 2babdaa327091d770fb93c75849d935fcc5578ca client: layers: unset layer config on logout diff -r 2babdaa32709 -r 8775bea8042a client/src/components/map/Map.vue --- a/client/src/components/map/Map.vue Tue Jun 18 14:15:29 2019 +0200 +++ b/client/src/components/map/Map.vue Tue Jun 18 14:39:36 2019 +0200 @@ -41,7 +41,7 @@ import { Stroke, Style, Fill } from "ol/style"; import { displayError } from "@/lib/errors"; import { pane } from "@/lib/mixins"; -import layers from "@/components/map/layers"; +import { layerFactory } from "@/components/map/layers"; import "ol/ol.css"; /* for the sake of debugging */ @@ -63,7 +63,7 @@ ...mapState("application", ["paneSetup", "paneRotate"]), ...mapState("imports", ["selectedStretchId", "selectedSectionId"]), layers() { - return layers(this.paneId); + return layerFactory(this.paneId); }, hasActiveInteractions() { return ( diff -r 2babdaa32709 -r 8775bea8042a client/src/components/map/layers.js --- a/client/src/components/map/layers.js Tue Jun 18 14:15:29 2019 +0200 +++ b/client/src/components/map/layers.js Tue Jun 18 14:39:36 2019 +0200 @@ -169,9 +169,13 @@ } }); -const layerConfigs = {}; +let layerConfigs = {}; -export default function(mapId) { +export const unsetLayerConfigs = function() { + layerConfigs = {}; +}; + +export const layerFactory = function(mapId) { const styles = styleFactory(mapId); // Shared feature source for layers: // BOTTLENECKS, BOTTLENECKSTATUS and BOTTLENECKFAIRWAYAVAILABILITY @@ -660,4 +664,4 @@ }, config }; -} +}; diff -r 2babdaa32709 -r 8775bea8042a client/src/lib/session.js --- a/client/src/lib/session.js Tue Jun 18 14:15:29 2019 +0200 +++ b/client/src/lib/session.js Tue Jun 18 14:39:36 2019 +0200 @@ -13,12 +13,14 @@ */ import app from "@/main"; +import { unsetLayerConfigs } from "@/components/map/layers"; const logOff = () => { app.$snotify.clear(); app.$store.commit("reset"); app.$store.commit("user/clearAuth"); app.$router.push("/login"); + unsetLayerConfigs(); }; /**