# HG changeset patch # User Thomas Junk # Date 1567001359 -7200 # Node ID 4f81082899c83da48a4b39b3a65a78b47cfae331 # Parent e4ff09ebc2c3e421ec211632485ded09d0d848c1 Legend: legend for bottlnecks isoline and differences should reload as well diff -r e4ff09ebc2c3 -r 4f81082899c8 client/src/components/layers/Layerselect.vue --- a/client/src/components/layers/Layerselect.vue Wed Aug 28 15:54:46 2019 +0200 +++ b/client/src/components/layers/Layerselect.vue Wed Aug 28 16:09:19 2019 +0200 @@ -56,7 +56,8 @@ ...mapState("map", [ "openLayersMaps", "isolinesLegendImgDataURL", - "differencesLegendImgDataURL" + "differencesLegendImgDataURL", + "ongoingRefresh" ]), ...mapGetters("map", ["openLayersMap"]), ...mapState("bottlenecks", ["selectedSurvey"]), @@ -67,7 +68,27 @@ return this.$gettext(this.layer.get("label")); } }, + watch: { + ongoingRefresh() { + if (this.ongoingRefresh) return; + this.refreshLegend(); + } + }, methods: { + refreshLegend() { + if (this.layer.get("id") === "BOTTLENECKISOLINE") { + this.loadLegendImage( + "sounding_results_contour_lines_geoserver", + "isolinesLegendImgDataURL" + ); + } + if (this.layer.get("id") === "DIFFERENCES") { + this.loadLegendImage( + "sounding_differences", + "differencesLegendImgDataURL" + ); + } + }, toggle(map) { if (map) { if ( @@ -141,18 +162,7 @@ } }, created() { - if (this.layer.get("id") === "BOTTLENECKISOLINE") { - this.loadLegendImage( - "sounding_results_contour_lines_geoserver", - "isolinesLegendImgDataURL" - ); - } - if (this.layer.get("id") === "DIFFERENCES") { - this.loadLegendImage( - "sounding_differences", - "differencesLegendImgDataURL" - ); - } + this.refreshLegend(); } };