From d70f569fa0b49bac0143a37cb337b1b933b57323 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Thu, 28 Mar 2024 13:35:05 +0100 Subject: [PATCH 01/19] Update print-legend.js --- src/controls/print/print-legend.js | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/controls/print/print-legend.js b/src/controls/print/print-legend.js index 514174b3a..19c38bc6d 100644 --- a/src/controls/print/print-legend.js +++ b/src/controls/print/print-legend.js @@ -170,14 +170,11 @@ const LayerRow = function LayerRow(options) { return getTitleWithIcon(title, getStyleIcon(style[0])); } - const hasThematicStyle = (layer.get('thematicStyling') === true); const children = style.map((thisStyle, index) => { - if (!(isHidden(thisStyle))) { - if ((!(hasThematicStyle)) || (!(thisStyle[0]?.visible === false))) { - const styleIcon = getStyleIcon(thisStyle); - const rowTitle = thisStyle[0].label ? thisStyle[0].label : index + 1; - return getListItem(rowTitle, styleIcon); - } + if (!isHidden(thisStyle)) { + const styleIcon = getStyleIcon(thisStyle); + const rowTitle = thisStyle[0].label ? thisStyle[0].label : index + 1; + return getListItem(rowTitle, styleIcon); } return ''; }); @@ -208,16 +205,11 @@ const LayerRow = function LayerRow(options) { return getTitleWithIcon(title, icon); } - const thematicStyle = (layer.get('thematicStyling') === true) ? viewer.getStyle(layer.get('styleName')) : undefined; - const rules = json.Legend[0].rules.reduce((okRules, rule, index) => { - if (!(layer.get('thematicStyling')) || thematicStyle[0]?.thematic[index]?.visible) { - const ruleImageUrl = `${getLegendGraphicUrl}&rule=${rule.name}`; - const rowTitle = rule.title ? rule.title : index + 1; - okRules.push(getListItem(rowTitle, ruleImageUrl, true)); - } - return okRules; - }, []); - + const rules = json.Legend[0].rules.map((rule, index) => { + const ruleImageUrl = `${getLegendGraphicUrl}&rule=${rule.name}`; + const rowTitle = rule.title ? rule.title : index + 1; + return getListItem(rowTitle, ruleImageUrl, true); + }); return getTitleWithChildren(title, rules); }; From 565e821e3f5be8d831b9ad7091e163fe014879fa Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Tue, 2 Apr 2024 11:36:02 +0200 Subject: [PATCH 02/19] Update legend.js --- src/controls/legend.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 925e01569..ec1f49706 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -600,7 +600,10 @@ const Legend = function Legend(options = {}) { addBackgroundButtons(backgroundLayers); toggleGroup = ToggleGroup({ components: backgroundLayerButtons, - cls: 'spacing-horizontal-small' + cls: 'spacing-horizontal-small', + style: { + 'line-height': 'normal' + } }); this.render(); this.dispatch('render'); From 54f3bd013d8d66e873f3f464ea522daa65f87a7a Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Tue, 2 Apr 2024 11:58:29 +0200 Subject: [PATCH 03/19] Update legend.js --- src/controls/legend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index ec1f49706..8192f5312 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -717,7 +717,7 @@ const Legend = function Legend(options = {}) { 'border-radius': '0.5rem', 'padding-bottom': '6px' }, - components: baselayerCmps + components: toggleGroup }); const mainContainerComponents = [overlaysCmp, visibleOverlaysCmp, toolsCmp, baselayersCmp]; From f8fc7490158984cd9b1113c1c753ec5fa08d03f7 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Tue, 2 Apr 2024 12:17:03 +0200 Subject: [PATCH 04/19] Update legend.js --- src/controls/legend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 8192f5312..2af6a5385 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -717,7 +717,7 @@ const Legend = function Legend(options = {}) { 'border-radius': '0.5rem', 'padding-bottom': '6px' }, - components: toggleGroup + components: backgroundLayerButtons }); const mainContainerComponents = [overlaysCmp, visibleOverlaysCmp, toolsCmp, baselayersCmp]; From 80d342d581d3f0519f3c899a351c7c659ca8f7d5 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Tue, 2 Apr 2024 12:36:26 +0200 Subject: [PATCH 05/19] Update legend.js --- src/controls/legend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 2af6a5385..af215fd6c 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -652,7 +652,7 @@ const Legend = function Legend(options = {}) { visibleOverlaysCmp = VisibleOverlays({ viewer, cls: `${contentCls} hidden`, style: contentStyle, labelOpacitySlider }); - const baselayerCmps = [toggleGroup]; + const baselayerCmps = toggleGroup; toolsCmp = El({ cls: 'flex padding-small no-shrink hidden', From 11bdd672510c666a65344b9f2456aa0073c2291a Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Wed, 3 Apr 2024 16:00:53 +0200 Subject: [PATCH 06/19] Update legend.js --- src/controls/legend.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index af215fd6c..925e01569 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -600,10 +600,7 @@ const Legend = function Legend(options = {}) { addBackgroundButtons(backgroundLayers); toggleGroup = ToggleGroup({ components: backgroundLayerButtons, - cls: 'spacing-horizontal-small', - style: { - 'line-height': 'normal' - } + cls: 'spacing-horizontal-small' }); this.render(); this.dispatch('render'); @@ -652,7 +649,7 @@ const Legend = function Legend(options = {}) { visibleOverlaysCmp = VisibleOverlays({ viewer, cls: `${contentCls} hidden`, style: contentStyle, labelOpacitySlider }); - const baselayerCmps = toggleGroup; + const baselayerCmps = [toggleGroup]; toolsCmp = El({ cls: 'flex padding-small no-shrink hidden', @@ -717,7 +714,7 @@ const Legend = function Legend(options = {}) { 'border-radius': '0.5rem', 'padding-bottom': '6px' }, - components: backgroundLayerButtons + components: baselayerCmps }); const mainContainerComponents = [overlaysCmp, visibleOverlaysCmp, toolsCmp, baselayersCmp]; From d663496d306b2fac15c3f9f17f3269ec39b210df Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Wed, 3 Apr 2024 16:02:33 +0200 Subject: [PATCH 07/19] Update togglegroup.js --- src/ui/togglegroup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/togglegroup.js b/src/ui/togglegroup.js index 9ea3ddc8f..9a46d46a5 100644 --- a/src/ui/togglegroup.js +++ b/src/ui/togglegroup.js @@ -45,7 +45,7 @@ const ToggleGroup = function ToggleGroup(options = {}) { this.dispatch('render'); }, render() { - return `
<${tagName} id="${this.getId()}" class="${cls}" style="${style}"> + return `
<${tagName} id="${this.getId()}" class="${cls}" style="${style}"> ${renderToggleItems(this.getComponents())}
`; } From 0438a17af410349d6fbb8ed7d14eb9316efdc061 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Wed, 3 Apr 2024 16:52:29 +0200 Subject: [PATCH 08/19] Update togglegroup.js --- src/ui/togglegroup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/togglegroup.js b/src/ui/togglegroup.js index 9a46d46a5..9ea3ddc8f 100644 --- a/src/ui/togglegroup.js +++ b/src/ui/togglegroup.js @@ -45,7 +45,7 @@ const ToggleGroup = function ToggleGroup(options = {}) { this.dispatch('render'); }, render() { - return `
<${tagName} id="${this.getId()}" class="${cls}" style="${style}"> + return `
<${tagName} id="${this.getId()}" class="${cls}" style="${style}"> ${renderToggleItems(this.getComponents())}
`; } From 1e6c7492e7b94e13cc86cd2fda19174dff9161e6 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Mon, 8 Apr 2024 09:19:37 +0200 Subject: [PATCH 09/19] Update legend.js --- src/controls/legend.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 925e01569..e2c2c68bf 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -195,9 +195,7 @@ const Legend = function Legend(options = {}) { viewer.dispatch('active:togglevisibleLayers'); }, style: { - 'vertical-align': 'bottom', - 'margin-bottom': '13px', - 'padding-right': '6px' + 'vertical-align': 'super' }, icon: '#ic_close_fullscreen_24px', iconStyle: { @@ -212,9 +210,7 @@ const Legend = function Legend(options = {}) { viewer.dispatch('active:togglevisibleLayers'); }, style: { - 'vertical-align': 'bottom', - 'margin-bottom': '13px', - 'padding-right': '6px' + 'vertical-align': 'super' }, icon: '#ic_open_in_full_24px', iconStyle: { @@ -665,9 +661,7 @@ const Legend = function Legend(options = {}) { closeButton = Button({ cls: 'icon-smaller small round grey-lightest', style: { - 'vertical-align': 'bottom', - 'margin-bottom': '8.5px', - 'margin-top': '-2px' + 'vertical-align': 'super' }, icon: '#ic_close_24px', state: closeButtonState, @@ -699,7 +693,7 @@ const Legend = function Legend(options = {}) { style: { display: 'inline', 'text-align': 'right', - 'margin-right': '6px' + 'margin-right': '0.1rem' }, components: legendControlCmps }); @@ -712,7 +706,7 @@ const Legend = function Legend(options = {}) { 'background-color': '#fff', 'border-top': '1px solid #dbdbdb', 'border-radius': '0.5rem', - 'padding-bottom': '6px' + 'line-height': '0' }, components: baselayerCmps }); From 3d37070bf747c1ca23842bb26085c35d0737ebc3 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Mon, 8 Apr 2024 11:12:50 +0200 Subject: [PATCH 10/19] Update overlays.js --- src/controls/legend/overlays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/legend/overlays.js b/src/controls/legend/overlays.js index 552dbae1d..d333e864a 100644 --- a/src/controls/legend/overlays.js +++ b/src/controls/legend/overlays.js @@ -63,7 +63,7 @@ const Overlays = function Overlays(options) { mainComponent: groupContainer, secondaryComponent: layerProps, cls: 'right flex width-100', - style: { width: '100%' }, + style: { width: '100%', display: 'flex' }, legendSlideNav: true, viewer }); From f944ddce72c25b3b5cfc5d2463950fa83d32026a Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Mon, 8 Apr 2024 11:32:35 +0200 Subject: [PATCH 11/19] Update visibleOverlays.js --- src/controls/legend/visibleOverlays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/legend/visibleOverlays.js b/src/controls/legend/visibleOverlays.js index 60bf4a733..15e4b3f50 100644 --- a/src/controls/legend/visibleOverlays.js +++ b/src/controls/legend/visibleOverlays.js @@ -50,7 +50,7 @@ const Overlays = function Overlays(options) { mainComponent: groupContainer, secondaryComponent: layerProps, cls: 'right flex width-100', - style: { width: '100%' }, + style: { width: '100%', display: 'flex' }, legendSlideNav: false, viewer }); From 1c94ed220bef35043c554bf6ef04ed16f638a4bc Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Mon, 8 Apr 2024 11:37:36 +0200 Subject: [PATCH 12/19] Update overlays.js --- src/controls/legend/overlays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/legend/overlays.js b/src/controls/legend/overlays.js index d333e864a..552dbae1d 100644 --- a/src/controls/legend/overlays.js +++ b/src/controls/legend/overlays.js @@ -63,7 +63,7 @@ const Overlays = function Overlays(options) { mainComponent: groupContainer, secondaryComponent: layerProps, cls: 'right flex width-100', - style: { width: '100%', display: 'flex' }, + style: { width: '100%' }, legendSlideNav: true, viewer }); From d07f9fd1c4b97bf25b9bdaff18ff9646e73de8d0 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Mon, 8 Apr 2024 11:48:31 +0200 Subject: [PATCH 13/19] Update legend.js --- src/controls/legend.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index e2c2c68bf..21a46e05a 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -195,7 +195,8 @@ const Legend = function Legend(options = {}) { viewer.dispatch('active:togglevisibleLayers'); }, style: { - 'vertical-align': 'super' + 'vertical-align': 'bottom', + 'margin-bottom': '0.45rem' }, icon: '#ic_close_fullscreen_24px', iconStyle: { @@ -210,7 +211,8 @@ const Legend = function Legend(options = {}) { viewer.dispatch('active:togglevisibleLayers'); }, style: { - 'vertical-align': 'super' + 'vertical-align': 'bottom', + 'margin-bottom': '0.45rem' }, icon: '#ic_open_in_full_24px', iconStyle: { From 83f9dfd725ae0de609a76c5c222a729e6c625b5a Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Mon, 8 Apr 2024 12:04:14 +0200 Subject: [PATCH 14/19] Update legend.js --- src/controls/legend.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 21a46e05a..3ebd02595 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -663,7 +663,8 @@ const Legend = function Legend(options = {}) { closeButton = Button({ cls: 'icon-smaller small round grey-lightest', style: { - 'vertical-align': 'super' + 'vertical-align': 'bottom', + 'margin-bottom': '0.2rem' }, icon: '#ic_close_24px', state: closeButtonState, From e50bbd62224cd2963f36e9f957ebef021c47a551 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Mon, 8 Apr 2024 12:21:29 +0200 Subject: [PATCH 15/19] Update print-legend.js --- src/controls/print/print-legend.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/controls/print/print-legend.js b/src/controls/print/print-legend.js index 19c38bc6d..514174b3a 100644 --- a/src/controls/print/print-legend.js +++ b/src/controls/print/print-legend.js @@ -170,11 +170,14 @@ const LayerRow = function LayerRow(options) { return getTitleWithIcon(title, getStyleIcon(style[0])); } + const hasThematicStyle = (layer.get('thematicStyling') === true); const children = style.map((thisStyle, index) => { - if (!isHidden(thisStyle)) { - const styleIcon = getStyleIcon(thisStyle); - const rowTitle = thisStyle[0].label ? thisStyle[0].label : index + 1; - return getListItem(rowTitle, styleIcon); + if (!(isHidden(thisStyle))) { + if ((!(hasThematicStyle)) || (!(thisStyle[0]?.visible === false))) { + const styleIcon = getStyleIcon(thisStyle); + const rowTitle = thisStyle[0].label ? thisStyle[0].label : index + 1; + return getListItem(rowTitle, styleIcon); + } } return ''; }); @@ -205,11 +208,16 @@ const LayerRow = function LayerRow(options) { return getTitleWithIcon(title, icon); } - const rules = json.Legend[0].rules.map((rule, index) => { - const ruleImageUrl = `${getLegendGraphicUrl}&rule=${rule.name}`; - const rowTitle = rule.title ? rule.title : index + 1; - return getListItem(rowTitle, ruleImageUrl, true); - }); + const thematicStyle = (layer.get('thematicStyling') === true) ? viewer.getStyle(layer.get('styleName')) : undefined; + const rules = json.Legend[0].rules.reduce((okRules, rule, index) => { + if (!(layer.get('thematicStyling')) || thematicStyle[0]?.thematic[index]?.visible) { + const ruleImageUrl = `${getLegendGraphicUrl}&rule=${rule.name}`; + const rowTitle = rule.title ? rule.title : index + 1; + okRules.push(getListItem(rowTitle, ruleImageUrl, true)); + } + return okRules; + }, []); + return getTitleWithChildren(title, rules); }; From e28222791c181259c6c65408228c206200d1b653 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Fri, 3 May 2024 10:42:50 +0200 Subject: [PATCH 16/19] Update legend.js --- src/controls/legend.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 3ebd02595..c03974998 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -196,7 +196,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.45rem' + 'margin-bottom': '0.4rem' }, icon: '#ic_close_fullscreen_24px', iconStyle: { @@ -212,7 +212,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.45rem' + 'margin-bottom': '0.4rem' }, icon: '#ic_open_in_full_24px', iconStyle: { @@ -664,7 +664,7 @@ const Legend = function Legend(options = {}) { cls: 'icon-smaller small round grey-lightest', style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.2rem' + 'margin-bottom': '0.15rem' }, icon: '#ic_close_24px', state: closeButtonState, From bb1096d6302826b701c85fe1b0bf822bbb20537c Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Fri, 3 May 2024 11:00:56 +0200 Subject: [PATCH 17/19] Update legend.js --- src/controls/legend.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index c03974998..813308193 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -196,7 +196,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.4rem' + 'margin-bottom': '0.45rem' }, icon: '#ic_close_fullscreen_24px', iconStyle: { @@ -212,7 +212,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.4rem' + 'margin-bottom': '0.45rem' }, icon: '#ic_open_in_full_24px', iconStyle: { From e0bd8b651ba7f6e199a409295562d09610b1ae0a Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Tue, 14 May 2024 12:10:27 +0200 Subject: [PATCH 18/19] Update legend.js --- src/controls/legend.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 813308193..f2fb0040c 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -196,7 +196,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.45rem' + 'margin': '0.45rem 0.5rem' }, icon: '#ic_close_fullscreen_24px', iconStyle: { @@ -212,7 +212,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.45rem' + 'margin': '0.45rem 0.5rem' }, icon: '#ic_open_in_full_24px', iconStyle: { @@ -664,7 +664,7 @@ const Legend = function Legend(options = {}) { cls: 'icon-smaller small round grey-lightest', style: { 'vertical-align': 'bottom', - 'margin-bottom': '0.15rem' + 'margin': '0.2rem 0' }, icon: '#ic_close_24px', state: closeButtonState, From 8811f2f50e601b91c483e9ec1f1cc935f9fcbd03 Mon Sep 17 00:00:00 2001 From: Henrik Uggla Date: Tue, 14 May 2024 12:13:01 +0200 Subject: [PATCH 19/19] Update legend.js --- src/controls/legend.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index f2fb0040c..2d0c48732 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -196,7 +196,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin': '0.45rem 0.5rem' + margin: '0.45rem 0.5rem' }, icon: '#ic_close_fullscreen_24px', iconStyle: { @@ -212,7 +212,7 @@ const Legend = function Legend(options = {}) { }, style: { 'vertical-align': 'bottom', - 'margin': '0.45rem 0.5rem' + margin: '0.45rem 0.5rem' }, icon: '#ic_open_in_full_24px', iconStyle: { @@ -664,7 +664,7 @@ const Legend = function Legend(options = {}) { cls: 'icon-smaller small round grey-lightest', style: { 'vertical-align': 'bottom', - 'margin': '0.2rem 0' + margin: '0.2rem 0' }, icon: '#ic_close_24px', state: closeButtonState,