Route ground legs along real roads via an OSRM directions proxy
- GET /api/directions proxies OSRM (OSRM_URL env, default public demo server) with validation, Leaflet-order geometry, 24h capped cache - Map draws straight lines first, then upgrades ground legs to road-following polylines with routed km (marked road) as directions arrive; silent fallback to great-circle on failure; air legs unchanged - README documents OSRM_URL
This commit is contained in:
@@ -73,6 +73,7 @@ export const api = {
|
||||
costs: (id) => get(`/api/trips/${id}/costs`),
|
||||
regenerateTransports: (id) => post(`/api/trips/${id}/transports/regenerate`, {}),
|
||||
},
|
||||
directions: (from, to) => get(`/api/directions?from=${from.lat},${from.lng}&to=${to.lat},${to.lng}`),
|
||||
entries: {
|
||||
create: (tripId, payload) => post(`/api/trips/${tripId}/entries`, payload),
|
||||
update: (id, patchBody) => patch(`/api/entries/${id}`, patchBody),
|
||||
|
||||
Reference in New Issue
Block a user