diff --git a/src/Logic/FeatureSource/Sources/LastClickFeatureSource.ts b/src/Logic/FeatureSource/Sources/LastClickFeatureSource.ts index ece8d156d..c95857d70 100644 --- a/src/Logic/FeatureSource/Sources/LastClickFeatureSource.ts +++ b/src/Logic/FeatureSource/Sources/LastClickFeatureSource.ts @@ -26,7 +26,12 @@ export class LastClickFeatureSource implements WritableFeatureSource { for (let i = 0; i < (layer.presets ?? []).length; i++) { const preset = layer.presets[i] const tags = new ImmutableStore(TagUtils.KVtoProperties(preset.tags)) - const { html } = layer.mapRendering[0].RenderIcon(tags, { + const rendering = layer.mapRendering[0] + if (!rendering) { + console.error("NO rendering for preset", layer.id) + continue + } + const { html } = rendering.RenderIcon(tags, { noSize: true, includeBadges: false, }) diff --git a/src/Models/ThemeConfig/Conversion/Validation.ts b/src/Models/ThemeConfig/Conversion/Validation.ts index b6b47c1a8..6e4f94071 100644 --- a/src/Models/ThemeConfig/Conversion/Validation.ts +++ b/src/Models/ThemeConfig/Conversion/Validation.ts @@ -1062,6 +1062,12 @@ export class PrevalidateLayer extends DesugaringStep { ) } + if (json.presets?.length > 0) { + if (!(json.pointRendering?.length > 0)) { + context.enter("presets").warn("A preset is defined, but there is no pointRendering") + } + } + if (json.source === "special") { if (!Constants.priviliged_layers.find((x) => x == json.id)) { context.err( @@ -1377,6 +1383,7 @@ export class ValidateLayer extends Conversion< context.err("Could not parse layer due to:" + e) return undefined } + for (let i = 0; i < (layerConfig.calculatedTags ?? []).length; i++) { const [_, code, __] = layerConfig.calculatedTags[i] try {