fix logic bug, make condition more readable

This commit is contained in:
Martin Raifer
2023-04-30 20:56:51 +02:00
committed by GitHub
parent 2ed1f0888e
commit 6f9bb116f3
+5 -2
View File
@@ -87,8 +87,11 @@ export function uiFieldAddress(field, context) {
function getNearPlaces() {
function isAddressable(d) {
return d.tags.name && d.tags.place ||
d.tags.boundary === 'administrative' && d.tags.admin_level >= 8;
if (d.tags.name) {
if (d.tags.place) return true;
if (d.tags.boundary === 'administrative' && d.tags.admin_level >= 8) return true;
}
return false;
}
return getNear(isAddressable, 'place', 200);