X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/9ad36e2ce2a63535b7071acd26bc819d989b2f17..3e213d26b00e549a6c583bf5066e1985aa3e0996:/src/pages/DetailsPage.svelte
diff --git a/src/pages/DetailsPage.svelte b/src/pages/DetailsPage.svelte
index 1f6d84e..225d1a0 100644
--- a/src/pages/DetailsPage.svelte
+++ b/src/pages/DetailsPage.svelte
@@ -56,6 +56,7 @@
function place_has_keywords(aThisPlace) {
// Return false if Nominatim API sends 'keywords: { name: [], address: [] }'
+ // Like no longer needed after Nominatim version 4.3
return (
aThisPlace.keywords && aThisPlace.keywords.name && aThisPlace.keywords.address
&& (aThisPlace.keywords.name.length > 0 || aThisPlace.keywords.address.length > 0)
@@ -94,10 +95,11 @@
- {#if (Array.isArray(aPlace.names)) }
- No Name
- {:else}
+ {#if aPlace.names && typeof (aPlace.names) === 'object'
+ && Object.keys(aPlace.names).length}
+ {:else}
+ No Name
{/if}
{aPlace.category}:{aPlace.type}
@@ -119,6 +121,7 @@
{aPlace.centroid.coordinates[1]},{aPlace.centroid.coordinates[0]}
+
{@html osmLink(aPlace)}
{aPlace.place_id}
@@ -127,6 +130,7 @@
)
{#if aPlace.calculated_wikipedia}
+
{@html wikipediaLink(aPlace)}
{/if}
@@ -222,7 +226,8 @@
Parent Of |
{#if api_request_params.hierarchy}
- {#if aPlace.hierarchy && typeof (aPlace.hierarchy) === 'object' && Object.keys(aPlace.hierarchy).length}
+ {#if aPlace.hierarchy && typeof (aPlace.hierarchy) === 'object'
+ && Object.keys(aPlace.hierarchy).length}
{#each Object.keys(aPlace.hierarchy) as type}
{type} |
{#each aPlace.hierarchy[type] as line}