hikeratlas / website

The https://www.hikeratlas.com website
1 stars 0 forks source link

client-side routing #2

Open cldellow opened 8 months ago

cldellow commented 8 months ago

I want rough client-side routing. e.g. click the Mt Shark trailhead, then click McBride's Camp: see a route mapped out, with distance. (And, later, show an elevation profile by querying elevation data.)

Ideally, it'd be fast enough that it's interactive -- as you drag your cursor, you see the distance updated.

For big networks, I think you'd use GraphHopper or OSRM. But I think the hiking use case is small enough that we can get by with something that runs client side, and is reusable on the web and mobile.

https://www.liedman.net/geojson-path-finder/ seems promising.

A challenge: it needs the network. We have the network encoded in vector tiles, which means they're likely split across tiles and simplified.

We could go spelunking in the tiles:

Or we could have a sidecar of information:

In the offline case, a user will have all the z14 tiles locally, which makes spelunking more viable.

But to start, let's do the sidecar approach.