Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make it possible to have more backgroud layers #1985

Merged
merged 12 commits into from
Mar 27, 2024
23 changes: 17 additions & 6 deletions src/controls/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ const Legend = function Legend(options = {}) {
viewer.dispatch('active:togglevisibleLayers');
},
style: {
'align-self': 'right',
'vertical-align': 'bottom',
'margin-bottom': '7px',
'padding-right': '6px'
},
icon: '#ic_close_fullscreen_24px',
Expand All @@ -211,7 +212,8 @@ const Legend = function Legend(options = {}) {
viewer.dispatch('active:togglevisibleLayers');
},
style: {
'align-self': 'right',
'vertical-align': 'bottom',
'margin-bottom': '7px',
'padding-right': '6px'
},
icon: '#ic_open_in_full_24px',
Expand Down Expand Up @@ -662,6 +664,10 @@ const Legend = function Legend(options = {}) {
const closeButtonState = isExpanded ? 'initial' : 'hidden';
closeButton = Button({
cls: 'icon-smaller small round grey-lightest',
style: {
'vertical-align': 'bottom',
'margin-bottom': '4px'
},
icon: '#ic_close_24px',
state: closeButtonState,
validStates: ['initial', 'hidden'],
Expand All @@ -688,7 +694,12 @@ const Legend = function Legend(options = {}) {
legendControlCmps.push(closeButton);

const legendControlCmp = El({
cls: 'grow flex justify-end align-center no-shrink',
cls: 'grow flex no-shrink',
style: {
display: 'inline',
'text-align': 'right',
'margin-right': '6px'
},
components: legendControlCmps
});

Expand All @@ -698,7 +709,6 @@ const Legend = function Legend(options = {}) {
cls: 'flex padding-small no-shrink',
style: {
'background-color': '#fff',
height: '50px',
'border-top': '1px solid #dbdbdb',
'border-radius': '0.5rem'
},
Expand All @@ -708,10 +718,11 @@ const Legend = function Legend(options = {}) {
const mainContainerComponents = [overlaysCmp, visibleOverlaysCmp, toolsCmp, baselayersCmp];

mainContainerCmp = El({
cls: 'flex column relative width-100',
cls: 'flex column relative',
components: mainContainerComponents,
style: {
'max-height': `${maxHeight}px`
'max-height': `${maxHeight}px`,
width: 'min-content'
}
});

Expand Down
Loading