changeset 4274:e4ff09ebc2c3

Legend: distancemarks axis reload
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 28 Aug 2019 15:54:46 +0200
parents 9abb63b6b80a
children 4f81082899c8
files client/src/components/layers/LegendElement.vue
diffstat 1 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/layers/LegendElement.vue	Wed Aug 28 14:31:19 2019 +0200
+++ b/client/src/components/layers/LegendElement.vue	Wed Aug 28 15:54:46 2019 +0200
@@ -48,9 +48,9 @@
       return this.layer.getType() === "VECTOR";
     },
     imgSrc() {
-      if (this.layer.get("id") === "DISTANCEMARKSAXIS") {
-        return require("@/assets/distancemarks-axis.png");
-      }
+      // if (this.layer.get("id") === "DISTANCEMARKSAXIS") {
+      //   return require("@/assets/distancemarks-axis.png");
+      // }
       return this.src;
     },
     id() {
@@ -106,10 +106,18 @@
         // TODO: Do something useful?
         return;
       }
-      this.url =
-        `/internal/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=` +
-        this.layer.getSource().getParams().LAYERS +
-        `&legend_options=columns:4;fontAntiAliasing:true`;
+      if (this.layer.get("id") !== "DISTANCEMARKSAXIS") {
+        this.url =
+          `/internal/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=` +
+          this.layer.getSource().getParams().LAYERS +
+          `&legend_options=columns:4;fontAntiAliasing:true`;
+      } else {
+        this.url =
+          `/internal/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=` +
+          this.layer.getSource().getParams().LAYERS +
+          `&legend_options=columns:1;fontAntiAliasing:true;forceLabels:off`;
+      }
+
       this.loadImageSrc();
     }
   },
@@ -187,5 +195,6 @@
 .legendelement {
   max-height: 1.5rem;
   width: 2rem;
+  overflow: hidden;
 }
 </style>