Routing
Is your feature request related to a problem? Please describe. Converting https://github.com/traccar/traccar-web/pull/1293 to a feature request
Would be nice to have routing. I see two use cases:
- Estimate the distance / time taken from any vehicle to a specific point. This could help the user check, for example, in real time, which is the nearest vehicle (in distance or time) to a specific job / service.
- Compare the actual trip / route of the vehicle with an estimated one. It would help customers check delays, device kms problems, wrong route decisions, etc. We could draw both lines on the map, actual vs estimated.
Describe the solution you'd like As stated by @jinzo, maplibre-gl-directions would be a good starting point.
I don't think maplibre-gl-directions is a good starting point. I think we should just call an API on backend and support different providers.
Yes, the api url in the configuration could be the traccar backend.
Right now it supports https://project-osrm.org/ and https://docs.mapbox.com/api/navigation/directions formats. Apparently doesn't support valhalla which I use and it's very good, but I'm sure it will in the future.
The problem is also that it connects directly to the provider. Ideally it connects to Traccar backend.
What do you mean? It connects to whatever url you put in the configuration, which like I said, could be the traccar backend.
Then we would have to implement a very specific API format compatible with the library.
Two popular open source routing engines are osrm and valhalla. And valhalla has an option to use osrm format, so it looks like a good choice.
I second this, if it has to be proxied thorough traccar backend, OSRM API is probably the way to go.
@jcardus Did you find any possible solution to help us? :/
@RafailStratiotis we have to agree on a "path" first.