GithubHelp home page GithubHelp logo

nominatim-ui's People

Contributors

botanegg avatar darkshredder avatar dependabot[bot] avatar lonvia avatar mtmail avatar nslxndr avatar otbutz avatar petoc avatar piskvor avatar ufoproger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nominatim-ui's Issues

Page doesn't load: assets.html missing

I can't run the latest version (or 1.2.0) from the dist directory. Firefox reports a 404 on a /assets.html file. I just can't find any reference to this file.

dist contains debug build after tag v2.0.0

It seems to /dist/ contains debug build due to bundle.js try to load livereload.js

When you try to rebuild with yarn build you can see changes in

dist/build/bundle.css        <-- just changed hashes
dist/build/bundle.js         <-- removed livereload module
dist/build/bundle.js.map

Remove polygon parameter from API and debug link

The API and details link on the search result page always contains a parameter 'polygon_geojson=1' because the geometry output is used on the map. But when looking at raw API output, the geometry information just gets in the way and makes the request slow. So I would suggest to remove this one parameter from the API and debug URLs.

testing - base tests for all pages

about page

  1. open about.html
    check page contains 'Nominatim is a search engine'

status page

  1. open status.html
    check page shows a Software version

search page

  1. check the HTML page title
    check if 'Data last updated: ... ago' is displayed
    check if there is a welcome message "Welcome to Nominatim"
  2. check if a map is displayed, look for '.leaflet-tile-loaded' elements
  3. fill form with 'city of london'
    press the search button
    check which URL path got loaded
    check if at least one result is displayed, count '.searchresults .result' elements
    check if 'Search for more results' button is displayed
    check if link to the raw API URL is displayed, this might fail due to #123
    check if link to the raw debug API URL is displayed
    check if map is displayed
    check if map contains a marker and polygon, look for 2 'leaflet-overlay-pane path' elements
    click on first 'details' link in the results and check that a new page gets loaded, which is a detail page and has a title ('h1' elements) with text 'City of London'
  4. click 'show map bounds' buttons
    check the '#map-position' element is displayed
    check the map center contains two coordinates
    check the map zoom contains a number
    check the viewbox contains four coordinates
    check last click is empty/undefined
    click the 'hide' button
    check the '#map-position' element is no longer displayed

reverse page

  1. fill form with lat=27.1750090510034, lon=78.04209025 and submit
    check there is one result, count '.searchresults .result' elements
    click the 'details' link in the result, check that the page is now a details page/url

details page

  1. open details.html
    fill form with W5013364 and submit
    check H1 title is 'Eiffel Tower'
    check there is a link to https://www.openstreetmap.org/way/5013364
  2. click 'display keywords'
    check the URL now contains 'keywords=1'
    check the page now has a header 'Name Keywords' and 'Address Keywords'
  3. click 'display child places'
    check the URL now contains 'hierarchy=1'
    check the page now has a header 'Parent Of'

Support for passing additional headers/query parameters to Nominatim API

There are situations when Nominatim API instance is secured and passing authentication token through header or query parameter is needed.

I have added simple support to configure both, headers and query parameters, but I am not sure if You would like to have it integrated.

Please take a look at https://github.com/petoc/nominatim-ui/tree/change and if You think it make sense, I can create pull request.

I think it can be useful for some users.

add customization features

Projects might install their own version or even fork of Nominatim and expose a user interface to internal or external users. The users might not be aware what data was imported, whom to contact or where/how to file bugs. To avoid confusing with the frontend running on https://nominatim.openstreetmap.org/ some customization should be possible

  • HTML title
  • Logo (URL)
  • welcome text
  • additional CSS rules
  • links to documentation
  • links/text how to report bugs

Default should be just "Nominatim Demo" and https://nominatim.openstreetmap.org/ will maintain some of the current content in their configuration (or fork).

class parameter missing in details link

The links to the details page in the result list and the details links in the details page are missing the class parameter. I believe that this is a regression against the old UI.

In addition to that the details page does not forward the class parameter to the API.

Production config.js should not be versioned

Currently you have to adapt dist/config.js to your local environment. That's inconvenient because it pollutes the git status. May I suggest that the file is moved to dist/config.js.example and then add instructions in the README to copy the file to dist/config.js and adapt the copy.

PS: I'm aware of the dotenv issue. I'm more looking for a quick fix of the git status pollution as this is a blocker for deploying on osm.org.

Provide a view for status.php

With the database versioning PR the status call has received some additional fields. And I'm also thinking to extend the status.php to report which backend server is being used for osm.org.

It might be nice to add a HTML view for all that.

introduce structured-search page

I tried making structured search its own top navigation link but it was too complex to keep track of the mode on page changes. Try if making it its own /advsearch.html page is easier.

Print error when welcome/about/any-page cannot be loaded on file:// scheme

When loading index.html or search.html from a file:// URL then the browser doesn't allow Javscript to fetch local files.

Firefox
Security Error: Content at file:///private/tmp/test3/nominatim-ui-3.0.0/dist/search.html may not load data from file:///private/tmp/test3/nominatim-ui-3.0.0/dist/reverse.html.

The error is printed in the browser console but maybe we can display something in the UI itself.

Display API error responses

For example we don't enforce numeric limits, so requesting https://nominatim.openstreetmap.org/search.php?q=London&limit=abc&format=jsonv2 will return

{"error":{"code":400,"message":"Integer number expected for parameter 'limit'"}}

That message should be displayed to the user.

Same for reverse searches with no results.
https://nominatim.openstreetmap.org/reverse.php?lat=-19.81327&lon=-142.88769&zoom=18&format=jsonv2

{"error":"Unable to geocode"}

(here it might be better to display a different message offering more help)

Page does not reload on search

On https://nominatim.openstreetmap.org/ui/search.html the page is not reloaded for multiple searches. To reproduce:

Console has:

Uncaught (in promise) TypeError: URL constructor: /search.php?q=suhl&polygon_geojson=1&format=jsonv2 is not a valid URL.
    Zt LastUpdated.svelte:15
    r index.mjs:35
    bt api_utils.js:31

I suspect that is has something to do with it.

I've updated to latest master last night, so this is likely a regression in one of the last commits.

Allow other URL parameters from the API

The Nominatim API allows a couple of other parameters that cannot be set via the UI. Lately I was missing limit, dedupe. Ideally they can all be set via the GUI at some point. For the moment it would just be nice if all additional parameters in the URL are forwarded as is to the API call.

remove jQuery

jQuery is still used for tab navigation and dropdown. Once Bootstrap v5 is released we should be able to remove the library completely.

Too many calls to status endpoint

A single load of the details page sends 12 calls to the status endpoint. The search page sends 7 calls to status. The reverse page even sends 16. Predictably the server starts blocking at some point.

Test scenario when API on / and UI in a subdirectory

idea:

nominatim.openstreetmap.org has their API on / and runs nominatim-ui in a subdirectory '/ui'. Maybe that unusual but it's the most used installation so we should add test cases.

Possibly by setting an environment variable, running an API proxy on '/' and just running the whole test suite again. Something we'd run with github actions but not part of the regular 'yarn test' run.

Back to results link on Details page

If one is searching and has navigated to one of the results' Details page, they might want to come back to the results. A "Back to results/search/xxx" would be beneficial.

P.S. One can also simply use the browser back button!

Cache last-updated API call

For every API call there is a second call to /status to display the last-updated time. It would be nice if the response would be cached, even nominatim.openstreetmap.org doesn't update faster than minutely. Ideally configurable, many installations only once per day.

Displaying "3 minutes ago" (full timestamp when you mouse-over the value) would be great.

review mobile responsive view

  • In mobile mode it is not obvious in which mode we are. Maybe repeat it somewhere in the input line?
  • Mobile mode could switch a bit earlier or the map could be a bit smaller for the medium sized view.

Feature Suggestion: Link to "Show details for place" on search page

On the starting page of nomination UI

https://nominatim.openstreetmap.org (which redirects to https://nominatim.openstreetmap.org/ui/search.html)

there's a link to "reverse search" but I'm missing a link to the "show details for place" search page

https://nominatim.openstreetmap.org/ui/details.html

Motivation:
I only found this "show details" search page by luck. I am new to OSM and I wanted to double check that my OSM ids are correct. The search box on openstreetmap.org does not accept OSM ids as search input and thus displays an empty results list including a link to the OpenStreetmap Nominatim server https://nominatim.openstreetmap.org. I followed this link and only by clicking back and forth I suddenly ended up on the "show details for place" search page https://nominatim.openstreetmap.org/ui/details.html. To ease access, I'd like to suggest to add a link to the "show details for place" search page prominently on the starting page of nomination UI.

Thank you.

"More results" link is missing

There used to be a link below the results for more results that went missing with the new UI. Either get the more link from the result or simply collect the place_ids to be excluded yourself.

Add a link to the debug view for the search

I used to get to the debug view of the search by adding a &debug=1 to the URL. That doesn't work anymore for obvious reasons. So it would be nice to have a link for that. The link neds to go to the original API with format=json (to avoid being redirected back to the UI because of the format being potentially HTML) and debug=1.

On details page add link to country

Example
https://nominatim.openstreetmap.org/ui/details.html?osmtype=R&osmid=2145268&class=boundary
in the address line lists has both 'Germany' and 'de' but no links to their OSM or detail pages.

The API doesn't return the ids but maybe we can still add a link in the UI, even if it goes to a search page.

    "address": [
        {
            "localname": "Bavaria",
            "place_id": 235644837,
            "osm_id": 2145268,
            "osm_type": "R",
            "place_type": "state",
            "class": "boundary",
            "type": "administrative",
            "admin_level": 4,
            "rank_address": 8,
            "distance": 0,
            "isaddress": true
        },
        {
            "localname": "Germany",
            "place_id": null,
            "osm_id": null,
            "osm_type": null,
            "place_type": null,
            "class": "place",
            "type": "country",
            "admin_level": null,
            "rank_address": 4,
            "distance": 0,
            "isaddress": true
        },
        {
            "localname": "de",
            "place_id": null,
            "osm_id": null,
            "osm_type": null,
            "place_type": null,
            "class": "place",
            "type": "country_code",
            "admin_level": null,
            "rank_address": 4,
            "distance": 0,
            "isaddress": false
        }
    ],

Add link for postcodes to Overpass-API

To help people find bad postcodes we could add a link in the details page next to the postcode to an Overpass query that shows all objects with that postcode in a 10km radius around the centroid of the place. It probably should include a little explanation why it is there and how to fix the postcodes.

Remove content fo `dist/build` from git repo

The content is no longer easily diffable between builds and tends to cause a lot of conflicts during development, so it has become a bit of a nuisance. There is also the real danger of shipping debug builds, see #47. So I'd vote for removing the content of dist/build from the repo and require that people using master to build first.

Some ideas for keeping it easily accessible for Nominatim software users:

  • create a github action that automaticaly creates a tarball of a compiled dist/ for every release and uploads it as an artefact to the release page
  • provide compiled and bundled versions with Nominatim that we update from time to time

Keep map bounds between search and reverse page

As noted in #114 we already keep the map center, but when clicking 'reverse' a search with highest zoom level gets started and the result will usually be very much zoomed in. We can't use zoom= in the URL, that's for the search. Possibly save the map state/bounds in a Svelte store.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.