Is possible to use the routing engine in react native on the client side (offline without server)?
We need build an offline maps app with OpenStreetMap and with routing feature on offline mode. so we need to know it's possible to make this engine run without command line?
I am a React Native developer and i don't have any experience with C++.
I would have a look at osmand for offline maps and routing. I don't think anyone made the osrm server part run in javascript only if I understand your question correctly
We've already taken a look at osmand the Android app. They have all the features we need, but we need to build this app with React Native, so we need to build a library that supports Android and iOS.
I tried to understand how they handle the offline routing, but I found the structure of the project too complex.
People have made OSRM run natively on Android and iOS, but it requires some pretty low-level C++ skills and an understanding of writing native code on those platforms. If you don't have any experience with C++, then it is not the first C++ project I would attempt.
The Valhalla routing project has also been built for Android/iOS - but it's similar in a way - you need to have reasonable C++ code and native platform skills to wire things up, it's not out-of-the-box.
Graphhopper is written in Java and may be easier to work with on Android, but I'm not sure how you'd fare on iOS.
The only "plug-and-play" options I know of are commercial systems, like Mapbox's Navigation SDK (disclaimer: I work for Mapbox). I'm not current on how easy they are to integrate with React Native though.
Thanks for the advice, I don't have a problem learning C++, but I want to know if it's possible to run this routing engine on React Native (without a command line). We can't run command line in React Native.
I will take a look at Valhalla. I've actually already taken a look at Mapbox it's good, but we're looking for a free service.
Yes - you can link against the libosrm.so module that is generated as part of the build and call routing functions directly.
Take a look at the C++ example here:
https://github.com/Project-OSRM/osrm-backend/blob/master/example/example.cpp
which shows how to call the routing functions on the library interface without running a separate process. How to get from the C++ interface into something React can understand is beyond my experience, you're on your own with that.
Thanks for that, I will try to make that work in React Native :)