osm-fr / osmose-frontend

Part of osmose that shows results on the website http://osmose.openstreetmap.fr
GNU General Public License v3.0
41 stars 38 forks source link

Map link in Byuser page #331

Closed Crashillo closed 3 years ago

Crashillo commented 3 years ago

https://github.com/osm-fr/osmose-frontend/blob/ef7476e33b8982011c8d1a63e5c43b0e06e730a0/web/src/pages/byuser/byuser.vue#L19-L24

The above snippet renders a plain link to the map view, ignoring any parameter set in the url. Append window.location.pathname to make the redirection properly.

frodrigo commented 3 years ago

I see a bug using this link when not opnening in an other tab. But I don't get you point with the parameter, the parameter is still here.

Crashillo commented 3 years ago

Try this page: http://osmose.openstreetmap.fr/en/byuser/Hugoren%20Martinako?username=Hugoren%20Martinako&item=1070&source=14087

You'll see there are two parameters: item=1070&source=14087, therefore, the table beneath is filtered with such conditions. However, the map link doesn't include them, so the map view displays different results. I've just seen the cookiesStorage messes this up (stores an old last_item/last_level versus the new url params).

The goal is about updating the map link in the byuser page, and whenever you click you'll go to the map with only the selected elements. I think it would be:

...
:to="`../map/#username=${username}&${query}`"
...
data() {
  return {
    ...
    query: ""
  }
}

Another fancy feature related with this will be using fitBounds leaflet function

frodrigo commented 3 years ago

Thank you, fixed.