From: Sarah Hoffmann Date: Tue, 2 Apr 2024 08:59:12 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/commitdiff_plain/daea333875ff6b51d99dea24997019e573e201c2?hp=3c8336e75b6d5da23b245748ddfbd2b19e7bec42 Merge remote-tracking branch 'upstream/master' --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adecae3..a070852 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,11 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: '16.x' + node-version: '18.x' - name: Install dependencies run: yarn install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a239e48..392cca2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,11 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: '16.x' + node-version: '18.x' - name: Install dependencies run: yarn install diff --git a/CHANGES.md b/CHANGES.md index 93c3f73..0cc68df 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,23 @@ # CHANGES +* version 3.5.1 - 2024-02-14 + * Automatic release creation for 3.5.0 failed on Github Actions + +* version 3.5.0 - 2024-02-14 + * Requires nodejs version 18 now + * Reverse page: add optional 'layer' parameter + * NPM package updates (Puppeteer 21 => 22, Rollup 3 => 4) + * Documentation: Show how to install into a nominatim-docker installation + +* version 3.4.0 - 2023-08-29 + * Search map: delete old viewbox rectangle before adding a new one + * Details page: Allow searching for negative OSM ids. + * Details page: Nominatim started returning empty hash instead of empty array when a place has no + names + * test-suite: Nominatim no longer returns streets as children of a city. Adjusted test to + look for children of a street instead + * NPM package updates + * version 3.3.0 - 2023-06-26 * Reverse map: show search position (red circle) also when no search results * test-suite: remove httpbin HTTP calls, server is unreliable @@ -12,7 +30,7 @@ * NPM package updates * version 3.2.11 - 2023-03-08 - * Configuration: You can now set Map_Default_Bounds als alternative to lat,lon, zoom. Thanks Piskvor + * Configuration: You can now set Map_Default_Bounds as alternative to lat,lon, zoom. Thanks Piskvor * NPM package updates * version 3.2.10 - 2023-01-06 @@ -24,7 +42,7 @@ * version 3.2.9 - 2022-11-16 - * Fix: For places tagged bulding=yes display the formatted label 'Building', not 'Yes' + * Fix: For places tagged building=yes display the formatted label 'Building', not 'Yes' * migrate remaining modules to ESM style (import instead of require) * NPM package updates * test suite: use JSON files for mocha and eslint configuration @@ -75,7 +93,7 @@ * version 3.1.0 - 2021-04-26 - * Configuration: new options to set API endpoint headers and additional paramters, thanks petoc + * Configuration: new options to set API endpoint headers and additional parameters, thanks petoc * Test suite: New test suite using a headless browser for UI interaction, thanks darkshredder * Fix: Links to API URL weren't displayed after a search * Fix: On result pages the map icons were not cleared between searches (caching issue) @@ -103,8 +121,8 @@ * 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: make sure links to children,hierarchy update after pageload, thx LiteratimBi for the report + * Details page: in hierarchy 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 @@ -159,7 +177,7 @@ * Reverse search: click on map triggers new search * Report-issue modal from version 1 was missing - * Removed search-url-params polyfill. Svelte doesnt support MSIE11 either + * Removed search-url-params polyfill. Svelte doesn't support MSIE11 either * version 2.0.1 - 2021-01-31 diff --git a/README-nominatim-docker.md b/README-nominatim-docker.md new file mode 100644 index 0000000..be662f9 --- /dev/null +++ b/README-nominatim-docker.md @@ -0,0 +1,41 @@ +# Adding nominatim-ui to a nominatim-docker container + +This document assumes you followed the [nominatim-docker](https://github.com/mediagis/nominatim-docker/) instructions. + +nominatim-ui is a separate project and it's not planned to add the UI to the nominatim-docker installation. + +The following instructions might still be useful and/or help further automate such an installation. + +```bash +# Log into the running container +docker exec -it nominatim /bin/bash + +# Download stable nominatim-ui release +# available versions: https://github.com/osm-search/nominatim-ui/releases +VERSION=3.4.0 +cd /tmp +curl -L --fail -o nominatim-ui.tar.gz https://github.com/osm-search/nominatim-ui/releases/download/v${VERSION}/nominatim-ui-${VERSION}.tar.gz +tar -xzf nominatim-ui.tar.gz && rm nominatim-ui.tar.gz +mv nominatim-ui-$VERSION nominatim-ui + +# Set the configuration. In this case the UI website should access the API +# from the same host and port +tee nominatim-ui/dist/theme/config.theme.js << 'EOF' +Nominatim_Config.Nominatim_API_Endpoint = '/'; +EOF + +# Apache configuration has an entry 'DirectoryIndex search.php'. To make +# /ui work we just create such a file. Alternatively change the entry for +# /ui directory. +# Apache configuration is in /etc/apache2/sites-enabled/000-default.conf +cd nominatim-ui/dist/ && ln -s index.html search.php && cd - + +# Move files to Apache webserver directory +mkdir /nominatim/website/ui +mv nominatim-ui/dist/* /nominatim/website/ui/ +rm -r nominatim-ui +chown -R nominatim:nominatim /nominatim/website/ui/ +``` + +If the API runs on http://some-host.example.org:8080/ then http://some-host.example.org:8080/ui +will now display a website including map and search box. \ No newline at end of file diff --git a/README.md b/README.md index fa4f021..46b8761 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ You can either * start a webserver using ([Big list of http static server one-liners](https://gist.github.com/willurd/5720255)) or configure Apache, nginx or other webservers to serve the `dist` directory. +* to add the files into a nominatim-docker container see [README-nominatim-docker](README-nominatim-docker.md) file ## Configuration diff --git a/package.json b/package.json index 28e36d5..23c2594 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nominatim-ui", "description": "Debug web interface for Nominatim geocoder", - "version": "3.3.0", + "version": "3.5.1", "license": "GPL-2.0", "scripts": { "build": "rollup -c", @@ -19,8 +19,8 @@ "http": "^0.0.1-security", "http-proxy": "^1.18.1", "mocha": "^10.0", - "puppeteer": "^20.0", - "rollup": "^3.3.0", + "puppeteer": "^22.0", + "rollup": "^4.9.0", "rollup-plugin-css-only": "^4.3.0", "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-svelte": "^7.0.0", diff --git a/src/components/Header.svelte b/src/components/Header.svelte index 97cbebd..0d678bd 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -17,8 +17,8 @@ if (!map) return; map.on('move', function () { - map_lat = map.getCenter().lat; - map_lon = map.getCenter().lng; + map_lat = map.getCenter().lat.toFixed(5); + map_lon = map.getCenter().lng.toFixed(5); }); }); diff --git a/src/components/Map.svelte b/src/components/Map.svelte index 37166f6..7b13187 100644 --- a/src/components/Map.svelte +++ b/src/components/Map.svelte @@ -127,13 +127,16 @@ if (viewbox) { let coords = viewbox.split(','); // ,,, let bounds = L.latLngBounds([coords[1], coords[0]], [coords[3], coords[2]]); - L.rectangle(bounds, { + let viewbox_on_map = L.rectangle(bounds, { color: '#69d53e', weight: 3, dashArray: '5 5', opacity: 0.8, - fill: false - }).addTo(map); + fill: false, + interactive: false + }); + map.addLayer(viewbox_on_map); + dataLayers.push(viewbox_on_map); } if (!aFeature) return; diff --git a/src/components/SearchSectionDetails.svelte b/src/components/SearchSectionDetails.svelte index f23a24c..5ca614a 100644 --- a/src/components/SearchSectionDetails.svelte +++ b/src/components/SearchSectionDetails.svelte @@ -6,8 +6,8 @@ function handleFormSubmit(event) { let form_el = event.target; let val = form_el.querySelector('input[type=edit]').value.trim(); - let type_and_id_match = val.match(/^\s*([NWR])(\d+)\s*$/i) - || val.match(/\/(relation|way|node)\/(\d+)\s*$/); + let type_and_id_match = val.match(/^\s*([NWR])(-?\d+)\s*$/i) + || val.match(/\/(relation|way|node)\/(-?\d+)\s*$/); var params = new URLSearchParams(); if (type_and_id_match) { @@ -30,7 +30,7 @@ @@ -81,11 +85,27 @@ {/each} +
+ +
+ Advanced options +
    +
  • + + +
  • +
+
+