view client/src/components/paneSetups.js @ 3678:8f58851927c0

client: make layer factory only return new layer config for individual maps instead of each time it is invoked. The purpose of the factory was to support multiple maps with individual layers. But returning a new config each time it is invoked leads to bugs that rely on the layer's state. Now this factory reuses the same objects it created before, per map.
author Markus Kottlaender <markus@intevation.de>
date Mon, 17 Jun 2019 17:31:35 +0200
parents fa7dc3f31ef3
children
line wrap: on
line source

const main = { id: "main", component: "Map" };

export const DEFAULT = { main };
export const COMPARESURVEYS = {
  main,
  compare: { id: "compare-survey", component: "Map" }
};
export const FAIRWAYPROFILE = {
  main,
  fairwayprofile: { id: "fairwayprofile", component: "Fairwayprofile" }
};

export const AVAILABLEFAIRWAYDEPTH = {
  main,
  availablefairwaydepth: {
    id: "availablefairwaydepth",
    component: "AvailableFairwayDepth"
  }
};

export const AVAILABLEFAIRWAYDEPTHLNWL = {
  main,
  availablefairwaydepth: {
    id: "availablefairwaydepthlnwl",
    component: "AvailableFairwayDepthLNWL"
  }
};

export const COMPARESURVEYS_FAIRWAYPROFILE = {
  main,
  compare: { id: "compare-survey", component: "Map" },
  fairwayprofile: { id: "fairwayprofile", component: "Fairwayprofile" }
};
export const GAUGE_WATERLEVEL = {
  main,
  waterlevel: { id: "gauge-waterlevel", component: "Waterlevel" }
};
export const GAUGE_HYDROLOGICALCONDITIONS = {
  main,
  hydrological: {
    id: "gauge-hydrologicalconditions",
    component: "HydrologicalConditions"
  }
};
export const GAUGE_WATERLEVEL_HYDROLOGICALCONDITIONS = {
  main,
  waterlevel: { id: "gauge-waterlevel", component: "Waterlevel" },
  hydrological: {
    id: "gauge-hydrologicalconditions",
    component: "HydrologicalConditions"
  }
};