Compare commits
2 commits
1ea90a0f69
...
e233c8dda6
| Author | SHA1 | Date | |
|---|---|---|---|
| e233c8dda6 | |||
| ca8aa335e5 |
1 changed files with 8 additions and 0 deletions
8
main.js
8
main.js
|
|
@ -132,6 +132,10 @@ for (let category of layerCategories) {
|
|||
const urlParams = qs.parse(window.location.search, { ignoreQueryPrefix: true });
|
||||
const urlLayers = ('layer' in urlParams) ? (typeof urlParams.layer === 'string' ? [urlParams.layer] : urlParams.layer) : [];
|
||||
|
||||
if (urlLayers.length > 0) {
|
||||
// Disable default-enabled layers if we're selecting layers via query params
|
||||
layerCategories.forEach(c => c.layers.forEach(l => l.enabled = false));
|
||||
}
|
||||
for (let category of layerCategories) {
|
||||
for (let layer of category.layers) {
|
||||
if (urlLayers.includes(layer.name)) {
|
||||
|
|
@ -149,6 +153,10 @@ for (let category of layerCategories) {
|
|||
}
|
||||
}
|
||||
}
|
||||
const sidebarVisible = ('sidebar' in urlParams) ? (urlParams.sidebar !== 'false') : true;
|
||||
if (!sidebarVisible) {
|
||||
document.body.classList.remove("nav-open");
|
||||
}
|
||||
|
||||
const customLayerDiv = document.createElement("div");
|
||||
customLayerDiv.innerHTML = `
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue