Allow disabling presets when re-using layers

This commit is contained in:
Robin van der Linde 2022-09-12 10:32:19 +02:00
parent db30470eca
commit c8475068d0
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D

View file

@ -215,6 +215,7 @@ export default class LayerConfig extends WithContextLoader {
this.minzoomVisible = json.minzoomVisible ?? this.minzoom
this.shownByDefault = json.shownByDefault ?? true
this.forceLoad = json.forceLoad ?? false
if (json.presets === null) json.presets = undefined
if (json.presets !== undefined && json.presets?.map === undefined) {
throw "Presets should be a list of items (at " + context + ")"
}