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

Add Leaflet-based Slippy Map To Website #124

Closed droogmic closed 2 years ago

droogmic commented 2 years ago

Working example, cleanups will be needed as a follow-up.

@dabreegster, I used your map as inspiration, but really struggled to get the mapbox library integrated, whereas leaflet has a rust lib already :D

droogmic commented 2 years ago

I propose leaving the cleanups, (including removing your slippy map demo @dabreegster?) to a future PR...

tordans commented 2 years ago

Don't know if I posted this before… This leaflet plugin might provide some inspiration about interaction and code/query.

I guess one could also use it to query the ways and then start with the osm2lanes part on top of that.

https://www.youtube.com/watch?v=JTzVa9E0Yo8 gives a good overview. https://github.com/plepe/leaflet-overpass-lens is the code.

droogmic commented 2 years ago

Don't know if I posted this before… This leaflet plugin might provide some inspiration about interaction and code/query.

I guess one could also use it to query the ways and then start with the osm2lanes part on top of that.

https://www.youtube.com/watch?v=JTzVa9E0Yo8 gives a good overview. https://github.com/plepe/leaflet-overpass-lens is the code.

hmm, don't think I saw this before, but I also don't think it adds much to our approach.

It seems they construct a geoJSON bounding box, whereas we just query overpass with around. Niether is the preferred solution to the problem of finding the closest way.

droogmic commented 2 years ago

I think the best example of what I am trying to do is: https://github.com/bbecquet/Leaflet.PolylineOffset with http://bbecquet.github.io/Leaflet.PolylineOffset/examples/example_cycle.html

droogmic commented 2 years ago

I would vote leaving the slippy map demo in the repo as example code. I deliberately wrote in JS and not Rust with a framework there, to make it easy to follow for people who want to hook the WASM library up to some regular JS app.

oh true, I hadn't thought of that. I might refactor it to document it more clearly for that purpose.