changeset 4396:b9f63a55815e

legend: make more robust detection of style. It could be an object or a function
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 13 Sep 2019 11:41:49 +0200
parents 3184210f50e9
children f7a32b0b9235
files client/src/components/layers/LegendElement.vue
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/layers/LegendElement.vue	Fri Sep 13 10:08:23 2019 +0200
+++ b/client/src/components/layers/LegendElement.vue	Fri Sep 13 11:41:49 2019 +0200
@@ -166,6 +166,9 @@
             [[-1.7, -1.2], [-1.7, 0.5], [1.7, 1.2], [1.7, -0.5]]
           ])
         });
+        if (typeof mapStyle === "function") {
+          mapStyle = mapStyle();
+        }
         mapStyle = new Style({
           stroke: new Stroke({
             color: mapStyle.getStroke().getColor(),