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

Start a demo of clicking a road and plugging it into osm2lanes #89

Closed dabreegster closed 2 years ago

dabreegster commented 2 years ago

The https://a-b-street.github.io/osm2lanes/ web interface is great, but an easier user flow is to just click a map and automatically grab the way from Overpass. This PR does the first half of that -- click a road in Mapbox, find the nearest way, display the road on the map (just as a line-string).

The second half will actually plug into osm2lanes; I'll resume #60 for that.

I'm doing this all in vanilla JS, no frameworks or anything. The goal is to make example code for other people to build off of, hopefully in time for FOSSGIS this weekend.

dabreegster commented 2 years ago

Oh yeah, the demo:

https://user-images.githubusercontent.com/1664407/157035652-34f75c27-d752-4f05-a7f9-9f0775cf533d.mp4

dabreegster commented 2 years ago

Thanks for the review, I'll merge.

Getting JS / Rust interop through wasm-bindgen is way harder than I expected. You can't even pass around a Vec<String> apparently. But there's some serde magic to/from JsValues that I'm looking into.