From 363d55206e1bfe7ca7716e9f0d17cf321b975721 Mon Sep 17 00:00:00 2001 From: marc tobias Date: Sat, 30 Nov 2019 20:36:37 +0100 Subject: [PATCH] Redone README, cut TODO in half --- README.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++--------- TODO.md | 45 +++++++++------------------------- 2 files changed, 72 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 0f1d3e3..b83cc8f 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,74 @@ # Nominatim-UI -Frontend for [Nominatim](https://nominatim.org/) ([source](https://github.com/openstreetmap/Nominatim/)) geocoder. +Debugging user interface for [Nominatim](https://nominatim.org/) +([source](https://github.com/openstreetmap/Nominatim/)) geocoder. +The frontend runs standalone as website and will requests data +from a separate Nominatim API (either on the same server or +remote). -Preview version. See TODO file. +Uses [jQuery](https://jquery.com/) for browser DOM interaction, +[handlebar](http://handlebarsjs.com/) templates to build pages, +[leaflet](https://leafletjs.com/) for map interaction, +[bootstrap](https://getbootstrap.com/) for layout styling. -http://handlebarsjs.com/ +## Background -## Installation +The user interface used to be included in the geocoder. Thus the +first version avoid being a redesign and still uses some of the +same configuration values. For simplicity it's not a single +page application (SPA) written in a framework though it could +be if complexity grows. -1. run build -``` -./build.sh -``` +## Starting the frontend -2. start any webserver to serve static files, e.g. +You can open the `dist` directory in your browser. -``` -php -S localhost:8000 -t dist -``` +You can start a simple webserver + + * PHP + + ``` + php -S 0.0.0.0:8000 -t dist + ``` + + * Python + + ``` + cd dist + python -m SimpleHTTPServer 8000 + # python 3 + python -m http.server 8000 + ``` + + * NodeJS + + ``` + # npm install -g light-server + light-server -s dist -p 8000 + ``` + + +## Configuration + +In `dist/config.js` you will find configuration options. The first +you want to doublecheck is the `Nominatim_API_Endpoint` URL. + + +## Building the frontend + +* Install dependencies + + ``` + yarn install + ``` + +* After you change files in `src` directory + + ``` + ./build.sh + ``` ## License diff --git a/TODO.md b/TODO.md index ca2026a..dbb1a9f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,57 +1,34 @@ # TODO list +* check output of /dist into repository? -## Essential - -* test in MSIE https://github.com/WebReflection/url-search-params -* Nominatim backend API - * need /status to support &format=json - * need /details to support &format=json -* reverse: zoom not set -http://localhost:8000/reverse.html?format=html&lat=52.3755991766591&lon=7.646484374999999&zoom= -* move this TODO.txt to github issues -* write install instructions -* check output of /dist into repository - ## Might never work -* pagination. API returns an array whichout indication if more results exist +* pagination. API returns an array without indication if more results exist * API returns category, type, but without admin_level we can't derive e.g. state,country * seeting acceptlanguage whichout a server component https://github.com/dansingerman/jQuery-Browser-Language -* nice 404 detail page. The API returns HTTP 400 error instead of an empty data set. - -## Unknown - -* config vs config.local.js -* should it be possible to add comments to config? -* snake_case vs camelCase -* support nearlat,nearlon parameters -* need a `` file -* do we an /src/assets directory? -* in which repository should the images/mapicons/ live? - ## Nice-to-have -* add permalink (like https://github.com/openstreetmap/Nominatim/pull/1003) +* support nearlat,nearlon parameters +* should images/mapicons/ be served from API server or this repo? * different content for official OSM, e.g. github urls * set HTML title -* cache `update_data_date` result +* cache `update_data_date` result somehow? * a new search causes a new pageview -* webpack or grunt build framework -* don't copy jquery/leaflet in /src, use dependency manager instead, e.g. https://bower.io/ * add tests with fixtures -* concatenate/minify JS and CSS * detailpage: make linkedplaces, childplaces optional (rarely used? second click to enable?) * set better alt tag for icons +* print text "loading..." instead of an error (which the user sees for a split second) +* concatenate/minify JS and CSS ## Code cleanup -* remove Perl dependency from build +* move TODO list into github issues * show map bounds section => move to handlebar template, map to partial -* make sure we use https URL to external sites where possible * aResults vs aPlace vs aFeature variable naming * use CSS preprocessor and linter -* use eslint - +* use eslint. It's already a dependency but throws errors +* cut line length (eslint warns when longer than 100) +* upgrade bootstrap v3 to v4 -- 2.45.1