Small fixes to the UK-addresses theme

This commit is contained in:
pietervdvn 2021-09-22 17:15:30 +02:00
parent 285ca2e508
commit e47224ecb8
2 changed files with 20 additions and 9 deletions

View file

@ -134,11 +134,18 @@ export class ExtraFunction {
args: ["list of features or layer name", "amount of features", "unique tag key (optional)", "maxDistanceInMeters (optional)"]
},
(params, feature) => {
return (features, amount, uniqueTag, maxDistanceInMeters) => ExtraFunction.GetClosestNFeatures(params, feature, features, {
maxFeatures: Number(amount),
uniqueTag: uniqueTag,
maxDistance: Number(maxDistanceInMeters)
})
return (features, amount, uniqueTag, maxDistanceInMeters) => {
let distance : number = Number(maxDistanceInMeters)
if(isNaN(distance)){
distance = undefined
}
return ExtraFunction.GetClosestNFeatures(params, feature, features, {
maxFeatures: Number(amount),
uniqueTag: uniqueTag,
maxDistance: distance
});
}
}
)

View file

@ -149,17 +149,17 @@
"mappings": [
{
"if": "addr:street:={_closest_street:0:name}",
"then": "<b>{_closest_street:0:name}</b> {_closest_street:0:distance}m",
"then": "Located in <b>{_closest_street:0:name}</b> (~{_closest_street:0:distance}m away)",
"hideInAnswer": "_closest_street:0:name="
},
{
"if": "addr:street:={_closest_street:1:name}",
"then": "<b>{_closest_street:1:name}</b> {_closest_street:1:distance}m",
"then": "Located in <b>{_closest_street:1:name}</b> (~{_closest_street:1:distance}m away)",
"hideInAnswer": "_closest_street:1:name="
},
{
"if": "addr:street:={_closest_street:2:name}",
"then": "<b>{_closest_street:2:name}</b> {_closest_street:2:distance}m",
"then": "Located in <b>{_closest_street:2:name}</b> (~{_closest_street:2:distance}m away)",
"hideInAnswer": "_closest_street:2:name="
}
],
@ -214,7 +214,11 @@
}
]
},
"presets": []
"presets": [
{
}
]
},
{
"id": "named_streets",