# HG changeset patch # User Fadi Abbud # Date 1550653201 -3600 # Node ID 33d2ef9f9e5d60884eeaa16edf10fafc2cc71c9a # Parent 4e325dda6a2d9a342c3940022de323837a99bd30 client: use the name constants for Layer names diff -r 4e325dda6a2d -r 33d2ef9f9e5d client/src/components/layers/Layerselect.vue --- a/client/src/components/layers/Layerselect.vue Wed Feb 20 08:53:30 2019 +0100 +++ b/client/src/components/layers/Layerselect.vue Wed Feb 20 10:00:01 2019 +0100 @@ -18,7 +18,7 @@ >{{ layername }} -
+
@@ -50,6 +50,7 @@ */ import { HTTP } from "@/lib/http"; import { mapState } from "vuex"; +import { LAYERS } from "@/store/map.js"; export default { props: ["layername", "layerindex", "isVisible"], name: "layerselect", @@ -57,7 +58,10 @@ LegendElement: () => import("./LegendElement.vue") }, computed: { - ...mapState("map", ["isolinesLegendImgDataURL"]) + ...mapState("map", ["isolinesLegendImgDataURL"]), + isBottleneckIsolineLayer() { + return this.layername == LAYERS.BOTTLENECKISOLINE; + } }, methods: { visibilityToggled() { @@ -67,7 +71,7 @@ created() { // fetch legend image for bottleneck isolines // directly read it as dataURL so it is reusable later - if (this.layername == "Bottleneck isolines") { + if (this.isBottleneckIsolineLayer) { const src = "/internal/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=sounding_results_contour_lines_geoserver&legend_options=columns:4;fontAntiAliasing:true"; HTTP.get(src, {