mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
wip
This commit is contained in:
parent
64c7fe1ec9
commit
3df52e002d
2 changed files with 30 additions and 2 deletions
|
@ -166,7 +166,8 @@
|
||||||
.umap-caption-bar button {
|
.umap-caption-bar button {
|
||||||
margin-inline-start: 10px;
|
margin-inline-start: 10px;
|
||||||
}
|
}
|
||||||
.umap-caption-bar button + button:before {
|
.umap-caption-bar > button + select:before,
|
||||||
|
.umap-caption-bar > button + button:before {
|
||||||
content: '|';
|
content: '|';
|
||||||
padding-inline-end: 10px;
|
padding-inline-end: 10px;
|
||||||
}
|
}
|
||||||
|
@ -196,7 +197,14 @@
|
||||||
z-index: var(--zindex-panels);
|
z-index: var(--zindex-panels);
|
||||||
}
|
}
|
||||||
.umap-caption-bar-enabled .umap-caption-bar {
|
.umap-caption-bar-enabled .umap-caption-bar {
|
||||||
display: block;
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
.umap-caption-bar select {
|
||||||
|
margin-top: 0;
|
||||||
|
line-height: initial;
|
||||||
|
height: initial;
|
||||||
|
width: auto;
|
||||||
}
|
}
|
||||||
.umap-caption-bar-enabled {
|
.umap-caption-bar-enabled {
|
||||||
--current-footer-height: var(--footer-height);
|
--current-footer-height: var(--footer-height);
|
||||||
|
|
|
@ -167,6 +167,7 @@ const BOTTOM_BAR_TEMPLATE = `
|
||||||
<button class="umap-about-link flat" type="button" title="${translate('Open caption')}" data-ref="caption">${translate('Open caption')}</button>
|
<button class="umap-about-link flat" type="button" title="${translate('Open caption')}" data-ref="caption">${translate('Open caption')}</button>
|
||||||
<button class="umap-open-browser-link flat" type="button" title="${translate('Browse data')}" data-ref="browse">${translate('Browse data')}</button>
|
<button class="umap-open-browser-link flat" type="button" title="${translate('Browse data')}" data-ref="browse">${translate('Browse data')}</button>
|
||||||
<button class="umap-open-browser-link flat" type="button" title="${translate('Filter data')}" data-ref="filter">${translate('Filter data')}</button>
|
<button class="umap-open-browser-link flat" type="button" title="${translate('Filter data')}" data-ref="filter">${translate('Filter data')}</button>
|
||||||
|
<select data-ref=layers></select>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -189,6 +190,17 @@ export class BottomBar extends WithTemplate {
|
||||||
this._umap.openBrowser('filters')
|
this._umap.openBrowser('filters')
|
||||||
)
|
)
|
||||||
this._slideshow.renderToolbox(this.element)
|
this._slideshow.renderToolbox(this.element)
|
||||||
|
this.elements.layers.addEventListener('change', () => {
|
||||||
|
const select = this.elements.layers
|
||||||
|
const selected = select.options[select.selectedIndex].value
|
||||||
|
this._umap.eachDataLayer((datalayer) => {
|
||||||
|
if (datalayer.id === selected) {
|
||||||
|
datalayer.show()
|
||||||
|
} else {
|
||||||
|
datalayer.hide()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
this.redraw()
|
this.redraw()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,6 +213,14 @@ export class BottomBar extends WithTemplate {
|
||||||
this.elements.caption.hidden = !showMenus
|
this.elements.caption.hidden = !showMenus
|
||||||
this.elements.browse.hidden = !showMenus
|
this.elements.browse.hidden = !showMenus
|
||||||
this.elements.filter.hidden = !showMenus || !this._umap.properties.facetKey
|
this.elements.filter.hidden = !showMenus || !this._umap.properties.facetKey
|
||||||
|
this.elements.layers.innerHTML = ''
|
||||||
|
this._umap.eachDataLayer((datalayer) => {
|
||||||
|
this.elements.layers.appendChild(
|
||||||
|
Utils.loadTemplate(
|
||||||
|
`<option value="${datalayer.id}">${datalayer.getName()}</option>`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue