X-Git-Url: https://git.openstreetmap.org/nominatim-ui.git/blobdiff_plain/9bd6e72026d6b978ed3f5004be73fd253ef82318..414ea07252f76f2114ab1e3c5c117d932155c665:/src/pages/DetailsPage.svelte
diff --git a/src/pages/DetailsPage.svelte b/src/pages/DetailsPage.svelte
index 34a7f63..baac180 100644
--- a/src/pages/DetailsPage.svelte
+++ b/src/pages/DetailsPage.svelte
@@ -4,7 +4,7 @@
import {
osmLink, wikipediaLink, coverageType, isAdminBoundary,
- formatAddressRank, formatKeywordToken
+ formatAddressRank, formatKeywordToken, formatOSMType
} from '../lib/helpers.js';
import Header from '../components/Header.svelte';
import MapIcon from '../components/MapIcon.svelte';
@@ -72,11 +72,11 @@
- {aPlace.localname}
+ {aPlace.localname || `${formatOSMType(aPlace.osm_type)} ${aPlace.osm_id}` }
link to this page
-
@@ -84,7 +84,13 @@
-
+
+ {#if (Array.isArray(aPlace.names)) }
+ No Name
+ {:else}
+
+ {/if}
+
{aPlace.category}:{aPlace.type}
{aPlace.indexed_date}
{#if (isAdminBoundary(aPlace)) }
@@ -157,20 +163,11 @@
{/if}
Keywords |
- {#if aPlace.keywords}
- Name Keywords |
- {#each aPlace.keywords.name as keyword}
-
- {formatKeywordToken(keyword.token)} |
- {#if keyword.id}
- word id: {keyword.id} |
- {/if}
-
- {/each}
+ {#if api_request_params.keywords}
- {#if aPlace.keywords.address}
- Address Keywords |
- {#each aPlace.keywords.address as keyword}
+ {#if aPlace.keywords && (aPlace.keywords.name || aPlace.keywords.address) }
+ Name Keywords |
+ {#each aPlace.keywords.name as keyword}
{formatKeywordToken(keyword.token)} |
{#if keyword.id}
@@ -178,6 +175,20 @@
{/if}
{/each}
+
+ {#if aPlace.keywords.address}
+ Address Keywords |
+ {#each aPlace.keywords.address as keyword}
+
+ {formatKeywordToken(keyword.token)} |
+ {#if keyword.id}
+ word id: {keyword.id} |
+ {/if}
+
+ {/each}
+ {/if}
+ {:else}
+ Place has no keywords |
{/if}
{:else}
@@ -189,17 +200,20 @@
{/if}
Parent Of |
- {#if aPlace.hierarchy}
-
- {#each Object.keys(aPlace.hierarchy) as type}
- {type} |
- {#each aPlace.hierarchy[type] as line}
-
- {/each}
- {/each}
+ {#if api_request_params.hierarchy}
+ {#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}
+
+ {/each}
+ {/each}
- {#if Object.keys(aPlace.hierarchy) > 500}
- There are more child objects which are not shown.
+ {#if Object.keys(aPlace.hierarchy) > 500}
+ There are more child objects which are not shown.
+ {/if}
+ {:else}
+ Place is not parent of other places |
{/if}
{:else}
@@ -249,6 +263,9 @@
border-top: none !important;
padding-left: 0 !important;
}
+ :global(span.noname){
+ color:#800;
+ }
#map-wrapper {
width:100%;