From b731d5eb2c0a9c320db5746eea115b58dad5fa9b Mon Sep 17 00:00:00 2001 From: hvangeffen Date: Thu, 13 Jun 2024 12:07:43 +0200 Subject: [PATCH] Only define custom range for color scales when it has been modified --- .../spatialdisplay/SpatialDisplayComponent.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/spatialdisplay/SpatialDisplayComponent.vue b/src/components/spatialdisplay/SpatialDisplayComponent.vue index e548b9e4..a82b4ec4 100644 --- a/src/components/spatialdisplay/SpatialDisplayComponent.vue +++ b/src/components/spatialdisplay/SpatialDisplayComponent.vue @@ -261,11 +261,18 @@ watch( }) colourScalesStore.scales[styleId] = newColourScale + const range = computed(() => { + const newRange = rangeToString(newColourScale.range) + const initialRange = rangeToString(newColourScale.initialRange) + + return newRange !== initialRange ? newRange : undefined + }) + const newLegendGraphic = useWmsLegend( baseUrl, legendLayerName, () => settings.useDisplayUnits, - () => rangeToString(newColourScale.range), + range, style, () => props.layerCapabilities?.styles ?? [], )