Fix error

This commit is contained in:
Pieter Vander Vennet 2023-11-11 14:52:01 +01:00
parent ffc8c59223
commit 7d3e5b6133
2 changed files with 13 additions and 1 deletions

View file

@ -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,
})

View file

@ -1062,6 +1062,12 @@ export class PrevalidateLayer extends DesugaringStep<LayerConfigJson> {
)
}
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 {