osm-search / Nominatim-Data-Analyser-Frontend

Frontend of the QA Tool for Nominatim. Helps to improve the OpenStreetMap data quality and therefore the Nominatim search results.
GNU General Public License v2.0
3 stars 3 forks source link

Store the state of the map view and current layer selected in the URL. #8

Closed AntoJvlt closed 3 years ago

AntoJvlt commented 3 years ago

Fixes #1

Implemented the URLStateManager which allows to store the current map view in the URL. Hence, we can reload the page and still have the same view on the map. The current layer selected is also stored in the URL so it gets automatically selected when reloading or when opening the page with an url containing a layer id.

lonvia commented 3 years ago

It's probably a good idea to stick to the convention established by https://openstreetmap.org. It creates a hash of the format: #map={z}/{x}/{y}&layers={layername}.

The layer selection doesn't work for me:

It might be nicer to use the short name of the layer instead of a number. That makes the URL future-proof against reordering of the layers.

AntoJvlt commented 3 years ago

I switched to the convention used by openstreetmap.org and bugs should be resolved now.

It is possible to copy map hash from the nominatim qa into openstreetmap.org even if the x coordinate can get a lot bigger (if you scroll a lot to the right of the map for example, because of the multiworld) on the nominatim qa tool. It gets automatically rescaled on openstreetmap.org.

Do you think that we are good on this? You can check the dev instance for the running example.

lonvia commented 3 years ago

osm.org uses an ampersand here:

#map=11.72/50.40/9.11?layer=boundary ways without relation
                     ^

Regarding the name being used: it looks like there is an id field in the layer.json that should have a unique machine compatible id. Currently this field is always set to SuspectsData. We should be setting that to some unique name consisting of [a-z0-9_] only and then use that for identification.

AntoJvlt commented 3 years ago

Oh yes little typo for the &.

I will update the analyser to add unique value for the id field of each rule and I will wait for it to spread on the server and over the generated data before modifying here.