Fix: presets will now also show if the layer doesn't have a name and is shown

This commit is contained in:
Pieter Vander Vennet 2022-04-19 00:57:36 +02:00
parent b1e304e05c
commit 3f18ce7fd3
2 changed files with 13 additions and 8 deletions

View file

@ -14,7 +14,7 @@ export default class AddNewMarker extends Combine {
let last = undefined;
for (const filteredLayer of filteredLayers) {
const layer = filteredLayer.layerDef;
if(layer.name === undefined){
if(layer.name === undefined && !filteredLayer.isDisplayed.data){
continue
}
for (const preset of filteredLayer.layerDef.presets) {

View file

@ -208,15 +208,20 @@ export default class SimpleAddUI extends Toggle {
const allButtons = [];
for (const layer of state.filteredLayers.data) {
if (layer.isDisplayed.data === false && !state.featureSwitchFilter.data) {
// The layer is not displayed and we cannot enable the layer control -> we skip
continue;
if (layer.isDisplayed.data === false) {
// The layer is not displayed...
if(!state.featureSwitchFilter.data){
// ...and we cannot enable the layer control -> we skip, as these presets can never be shown anyway
continue;
}
if (layer.layerDef.name === undefined) {
// this layer can never be toggled on in any case, so we skip the presets
continue;
}
}
if (layer.layerDef.name === undefined) {
// this is a parlty hidden layer
continue;
}
const presets = layer.layerDef.presets;
for (const preset of presets) {