Explicitely use map default when dynamic var is unset

This commit is contained in:
Yohan Boniface 2023-08-09 09:06:26 +02:00
parent 8758c0dc65
commit 1d0c7008fa

View file

@ -278,10 +278,8 @@ L.U.FeatureMixin = {
let value = this.getOption(option, fallback)
// There is a variable inside.
if (typeof value === 'string' && value.indexOf('{') != -1) {
value = L.Util.greedyTemplate(value, this.properties)
// We've not been able to replace the variable, let's reset
// so we can set a decent default at next step.
if (value.indexOf('{') != -1) value = undefined
value = L.Util.greedyTemplate(value, this.properties, true)
if (value.indexOf('{') != -1) value = this.map.getDefaultOption(option)
}
return value
},