forked from MapComplete/MapComplete
Small fixes to the UK-addresses theme
This commit is contained in:
parent
285ca2e508
commit
e47224ecb8
2 changed files with 20 additions and 9 deletions
|
@ -134,11 +134,18 @@ export class ExtraFunction {
|
||||||
args: ["list of features or layer name", "amount of features", "unique tag key (optional)", "maxDistanceInMeters (optional)"]
|
args: ["list of features or layer name", "amount of features", "unique tag key (optional)", "maxDistanceInMeters (optional)"]
|
||||||
},
|
},
|
||||||
(params, feature) => {
|
(params, feature) => {
|
||||||
return (features, amount, uniqueTag, maxDistanceInMeters) => ExtraFunction.GetClosestNFeatures(params, feature, features, {
|
|
||||||
|
return (features, amount, uniqueTag, maxDistanceInMeters) => {
|
||||||
|
let distance : number = Number(maxDistanceInMeters)
|
||||||
|
if(isNaN(distance)){
|
||||||
|
distance = undefined
|
||||||
|
}
|
||||||
|
return ExtraFunction.GetClosestNFeatures(params, feature, features, {
|
||||||
maxFeatures: Number(amount),
|
maxFeatures: Number(amount),
|
||||||
uniqueTag: uniqueTag,
|
uniqueTag: uniqueTag,
|
||||||
maxDistance: Number(maxDistanceInMeters)
|
maxDistance: distance
|
||||||
})
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -149,17 +149,17 @@
|
||||||
"mappings": [
|
"mappings": [
|
||||||
{
|
{
|
||||||
"if": "addr:street:={_closest_street:0:name}",
|
"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="
|
"hideInAnswer": "_closest_street:0:name="
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"if": "addr:street:={_closest_street:1: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="
|
"hideInAnswer": "_closest_street:1:name="
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"if": "addr:street:={_closest_street:2: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="
|
"hideInAnswer": "_closest_street:2:name="
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -214,7 +214,11 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"presets": []
|
"presets": [
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "named_streets",
|
"id": "named_streets",
|
||||||
|
|
Loading…
Add table
Reference in a new issue