]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
detailspage: children, hierarchy link didnt update after new data loaded (#100)
authormtmail <mtmail@gmx.net>
Fri, 5 Mar 2021 17:37:57 +0000 (18:37 +0100)
committerGitHub <noreply@github.com>
Fri, 5 Mar 2021 17:37:57 +0000 (18:37 +0100)
src/components/DetailsOneRow.svelte
src/components/Header.svelte
src/components/ReverseLink.svelte
src/pages/DetailsPage.svelte

index 9b3b27e22ba8e8b0763a020358c79837095dc525..7455245a2e1ce88407ae10f2b00debbd0897048a 100644 (file)
@@ -7,12 +7,13 @@
 
   export let addressLine;
   export let bDistanceInMeters;
+  export let bMarkUnusedLines = false;
 
   $: bAddressLineUsed = addressLine.isaddress;
 
 </script>
 
-<tr class:notused={!bAddressLineUsed}>
+<tr class:notused={bMarkUnusedLines && !bAddressLineUsed}>
   <td class="name font-weight-bold">
     {#if addressLine.localname}
       {addressLine.localname}
@@ -29,9 +30,9 @@
     {#if addressLine.osm_id}
       <DetailsLink feature={addressLine}>details</DetailsLink>
     {:else if addressLine.type.match(/^country/)}
-      <PageLink page='search', params_hash={{ country: addressLine.localname }}>search by name</PageLink>
+      <PageLink page='search' params_hash={{ country: addressLine.localname }}>search by name</PageLink>
     {:else if addressLine.type === 'postcode'}
-      <PageLink page='search', params_hash={{ postalcode: addressLine.localname }}>search by name</PageLink>
+      <PageLink page='search' params_hash={{ postalcode: addressLine.localname }}>search by name</PageLink>
     {/if}
   </td>
 </tr>
index 4e6359a2a7e11fcde699752ce7690c86c20fd9cb..9fef1f9615690ddd996eac4e7f9a562d2d573581 100644 (file)
       <!-- Left-aligned links -->
       <ul class="navbar-nav mr-auto">
         <li class="nav-item {view === 'search' ? 'active' : ''}">
-          <PageLink page="search" extra_classes="nav-link ">Search</PageLink>
+          <PageLink page="search" extra_classes="nav-link">Search</PageLink>
         </li>
         <li class="nav-item {view === 'reverse' ? 'active' : ''}">
           <ReverseLink extra_classes="nav-link ">Reverse</ReverseLink>
         </li>
         <li class="nav-item {view === 'details' ? 'active' : ''}">
-          <PageLink page="details" extra_classes="nav-link ">Search By ID</PageLink>
+          <PageLink page="details" extra_classes="nav-link">Search By ID</PageLink>
         </li>
       </ul>
     </div>
     <!-- Right aligned links -->
     <ul class="navbar-nav">
       <li class="nav-item {view === 'about' ? 'active' : ''}">
-        <PageLink page="about" extra_classes="nav-link ">About & Help</PageLink>
+        <PageLink page="about" extra_classes="nav-link">About & Help</PageLink>
       </li>
     </ul>
   </nav>
index 2fd2c4ceebe15435286ab6b47087ee9c6ae7e9c0..bbd54d77cc0b0f4214be3975d2e7c26a92d9814d 100644 (file)
@@ -1,8 +1,8 @@
 <script>
 import { refresh_page } from '../lib/stores.js';
 
-export let lat;
-export let lon;
+export let lat = null;
+export let lon = null;
 export let zoom = null;
 export let extra_classes = '';
 
index bb72e14fd8800abccfec4cfbcaec181133b6525d..500c5c30248062c1964789ffb9a63988acecfeb8 100644 (file)
@@ -16,7 +16,7 @@
   import Map from '../components/Map.svelte';
 
   let aPlace;
-  let base_url = window.location.search;
+  let base_url;
   let api_request_params;
   let api_request_finished = false;
 
@@ -57,6 +57,7 @@
     let pageinfo = $page;
     if (pageinfo.tab === 'details') {
       loaddata(pageinfo.params);
+      base_url = window.location.search;
     }
   }
 </script>
           <tbody>
             {#if aPlace.address}
               {#each aPlace.address as addressLine}
-                <DetailsOneRow addressLine={addressLine} bDistanceInMeters=false />
+                <DetailsOneRow addressLine={addressLine} bMarkUnusedLines=true bDistanceInMeters=false />
               {/each}
             {/if}
 
             {#if aPlace.linked_places}
               <tr class="all-columns"><td colspan="6"><h2>Linked Places</h2></td></tr>
               {#each aPlace.linked_places as addressLine}
-                <DetailsOneRow addressLine={addressLine} bDistanceInMeters=true />
+                <DetailsOneRow addressLine={addressLine} bMarkUnusedLines=true bDistanceInMeters=true />
               {/each}
             {/if}
 
                 </tr>
               {/each}
 
-              <tr class="all-columns"><td colspan="6"><h3>Address Keywords</h3></td></tr>
-              {#each aPlace.keywords.address as keyword}
-                <tr>
-                  <td>{formatKeywordToken(keyword.token)}</td>
-                  {#if keyword.id}
-                    <td>word id: {keyword.id}</td>
-                  {/if}
-              </tr>
-              {/each}
+              {#if aPlace.keywords.address}
+                <tr class="all-columns"><td colspan="6"><h3>Address Keywords</h3></td></tr>
+                {#each aPlace.keywords.address as keyword}
+                  <tr>
+                    <td>{formatKeywordToken(keyword.token)}</td>
+                    {#if keyword.id}
+                      <td>word id: {keyword.id}</td>
+                    {/if}
+                  </tr>
+                {/each}
+              {/if}
             {:else}
               <tr>
                 <td>