a-b-street / osm2lanes

A common library and set of test cases for transforming OSM tags to lane specifications
https://a-b-street.github.io/osm2lanes/
Apache License 2.0
34 stars 2 forks source link

Website Slippy Map #64

Closed droogmic closed 2 years ago

droogmic commented 2 years ago

The website https://a-b-street.github.io/osm2lanes/ has a "OSM Way ID", but it would be easier to select this from a slippy map.

droogmic commented 2 years ago

As mentioned by @dabreegster , but I don't really know how to approach this.

dabreegster commented 2 years ago

A simple idea to start -- use a normal slippy map, add a click handler that gives the lat,lng clicked, feed that into Overpass and look for road-like ways nearby (with the around modifier?), have the rest of the web interface below that.

With MapboxGL, getting clicks is easy: https://docs.mapbox.com/mapbox-gl-js/example/queryrenderedfeatures-around-point/ Leaflet also exposes an on-click event: https://leafletjs.com/reference.html#map-event

tordans commented 2 years ago

I can help with that if it's OK to have it simple JS + HTML. Will need/take a few days, though. First idea: I was thinking about a two-frame-solution where there is a separate map left and on click the right frame with the https://a-b-street.github.io/osm2lanes/ UI shows up. The UI at https://a-b-street.github.io/osm2lanes/ would need to have an option to take the way-ID via URL param.

droogmic commented 2 years ago

would need to have an option to take the way-ID via URL param

This can probably done with a yew router: https://yew.rs/docs/concepts/router

dabreegster commented 2 years ago

We now have this in a vanilla JS version: https://github.com/a-b-street/osm2lanes/blob/main/web/index.html It'd be nice to combine the two still. Should we add some kind of hideable Mapbox panel in the yew version?

droogmic commented 2 years ago

And we now have a version on the website thanks to https://github.com/a-b-street/osm2lanes/pull/124