diff client/src/components/map/layers.js @ 3548:f3102fa16a69

client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps This layer displays features based on which other layers are visible. To detect those other layers visibility realiably, the layer needs to be aware about the map it belongs to.
author Markus Kottlaender <markus@intevation.de>
date Fri, 31 May 2019 12:45:30 +0200
parents 47c61ea894b1
children 32d7bb1afdc9 f9032442620a
line wrap: on
line diff
--- a/client/src/components/map/layers.js	Fri May 31 12:20:08 2019 +0200
+++ b/client/src/components/map/layers.js	Fri May 31 12:45:30 2019 +0200
@@ -13,7 +13,7 @@
 import OSM from "ol/source/OSM";
 import { equalTo } from "ol/format/filter";
 import { HTTP } from "@/lib/http";
-import styles from "./styles";
+import styleFactory from "./styles";
 import store from "@/store/index";
 
 const buildVectorLoader = (
@@ -162,7 +162,8 @@
   }
 });
 
-export default function() {
+export default function(mapId) {
+  const styles = styleFactory(mapId);
   // Shared feature source for layers:
   // BOTTLENECKS, BOTTLENECKSTATUS and BOTTLENECKFAIRWAYAVAILABILITY
   // Reduces bottlenecks_geoserver requests and number of stored feature objects.