# CHANGES
+* version 3.0.2 - 2021-03-05
+
+ * Details page: don't print 'null' when postcode is missing
+ * Details page: make sure links to children,hierarcy update after pageload, thx LiteratimBi for the report
+ * Details page: in hierachy list all addresslines were marked unused (grayed out)
+ * Details page: API doesn't always return address keywords
+ * PageLinks/ReverseLink: fix warnings when properties not set
+
+* version 3.0.1 - 2021-03-05
+
+ * Details page: table is now responsive, no longer overflows
+ * Documentation: fix link to theme configuration file
+
* version 3.0.0 - 2021-02-25
Version 3 add a new directory dist/theme/. It changes the default welcome, about and
{
"name": "nominatim-ui",
"description": "Debug web interface for Nominatim geocoder",
- "version": "3.0.0",
+ "version": "3.0.2",
"license": "GPL-2.0",
"scripts": {
"build": "rollup -c",
</script>
<style>
- .name{
+ .name {
font-weight: bold;
+ overflow-wrap: anywhere;
}
</style>
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}
{#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>
<!-- 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>
<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 = '';
var fetch_content_cache = {};
export async function fetch_content_into_element(url, dom_element) {
+ if (!window.location.protocol.match(/^http/)) {
+ dom_element.innerHTML = `Cannot display data from ${url} here. `
+ + 'Browser security prevents loading content from file:// URLs.';
+ return;
+ }
+
if (fetch_content_cache[url]) {
dom_element.innerHTML = fetch_content_cache[url];
return;
}
- await fetch(url)
- .then(response => response.text())
- .then(html => {
- html = html.replace('Nominatim_API_Endpoint', Nominatim_Config.Nominatim_API_Endpoint);
- dom_element.innerHTML = html;
- fetch_content_cache[url] = html;
- });
+ try {
+ await fetch(url)
+ .then(response => response.text())
+ .then(html => {
+ html = html.replace('Nominatim_API_Endpoint', Nominatim_Config.Nominatim_API_Endpoint);
+ dom_element.innerHTML = html;
+ fetch_content_cache[url] = html;
+ });
+ } catch (error) {
+ dom_element.innerHTML = `Error fetching content from ${url} (${error})`;
+ }
}
function generate_nominatim_api_url(endpoint_name, params) {
if (param_str) {
param_str = '?' + param_str;
}
- window.history.pushState([], '', pagename + '.html' + param_str);
+ let new_url = pagename + '.html' + param_str;
+
+ if (window.location.protocol.match(/^http/)) {
+ window.history.pushState([], '', new_url);
+ } else {
+ window.location.href = new_url;
+ }
}
page.set({ tab: pagename, params: params });
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;
let pageinfo = $page;
if (pageinfo.tab === 'details') {
loaddata(pageinfo.params);
+ base_url = window.location.search;
}
}
</script>
</div>
<div class="row">
<div class="col-md-6">
- <table id="locationdetails" class="table table-striped">
+ <table id="locationdetails" class="table table-striped table-responsive">
<tbody>
<InfoRow title="Name"><InfoRowList items={aPlace.names} /></InfoRow>
<InfoRow title="Type">{aPlace.category}:{aPlace.type}</InfoRow>
<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>
padding-left: 0 !important;
}
- .table {
- width: 100%;
- }
#map-wrapper {
width:100%;
min-height: auto;