Mercurial > gemma
changeset 2273:4eeaba4ef573
client: rename the Fairway Dimensions layers
* change the Fairway layers names and adjust the related code in Maplayer.vue
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Thu, 14 Feb 2019 16:22:56 +0100 |
parents | f06e9e0cb790 |
children | ad9ede1a9e11 |
files | client/src/components/Maplayer.vue client/src/store/map.js |
diffstat | 2 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/Maplayer.vue Thu Feb 14 16:15:36 2019 +0100 +++ b/client/src/components/Maplayer.vue Thu Feb 14 16:22:56 2019 +0100 @@ -39,6 +39,7 @@ import { equalTo } from "ol/format/filter.js"; import { Stroke, Style, Fill } from "ol/style.js"; import { displayError } from "@/lib/errors.js"; +import { LAYERS } from "@/store/map.js"; /* for the sake of debugging */ /* eslint-disable no-console */ @@ -210,9 +211,13 @@ // TODO make display of layers more dynamic, e.g. from a list // load different fairway dimension layers (level of service) - ["1", "2", "3"].forEach(los => { + [ + LAYERS.FAIRWAYDIMENSIONSLOS1, + LAYERS.FAIRWAYDIMENSIONSLOS2, + LAYERS.FAIRWAYDIMENSIONSLOS3 + ].forEach((los, i) => { // loading the full WFS layer without bboxStrategy - var source = this.getVSourceByName("Fairway Dimensions LOS " + los); + var source = this.getVSourceByName(los); /*eslint-disable no-unused-vars */ var loader = function(extent, resolution, projection) { var featureRequest = new WFS().writeGetFeature({ @@ -221,7 +226,7 @@ featurePrefix: "gemma", featureTypes: ["fairway_dimensions"], outputFormat: "application/json", - filter: equalTo("level_of_service", los) + filter: equalTo("level_of_service", i + 1) }); featureRequest["outputFormat"] = "application/json"; @@ -245,7 +250,7 @@ }); }; - layer = this.getLayerByName("Fairway Dimensions LOS " + los); + layer = this.getLayerByName(los); layer.data.getSource().setLoader(loader); });
--- a/client/src/store/map.js Thu Feb 14 16:15:36 2019 +0100 +++ b/client/src/store/map.js Thu Feb 14 16:22:56 2019 +0100 @@ -38,9 +38,9 @@ INLANDECDIS: "Inland ECDIS chart Danube", WATERWAYAREA: "Waterway Area", STRETCHES: "Stretches", - FAIRWAYDIMENSIONSLOS1: "Fairway Dimensions LOS 1", - FAIRWAYDIMENSIONSLOS2: "Fairway Dimensions LOS 2", - FAIRWAYDIMENSIONSLOS3: "Fairway Dimensions LOS 3", + FAIRWAYDIMENSIONSLOS1: "LOS 1 Fairway Dimensions", + FAIRWAYDIMENSIONSLOS2: "LOS 2 Fairway Dimensions", + FAIRWAYDIMENSIONSLOS3: "LOS 3 Fairway Dimensions", WATERWAYAXIS: "Waterway Axis", WATERWAYPROFILES: "Waterway Profiles", BOTTLENECKS: "Bottlenecks",