How to use roundtrip in react native


Im looking to implement round trip in my program where i get a user input for distance then i map a route from their location with a distance of 5KM. I have had a look at the API calls in the documents but i dont see anything that i can use for round trips.

Hi @Williamk28

round_trip is a nested parameter of options in{profile}/post

You can also use out Javascript library to interact with the ORS API.

Hi @amoncaldas

I managed to get round_trip working using openrouteservies-js, is there a way to display this on a map? I have returned the route as a String and im using react-native-maps.

Hey @Williamk28
Yes, there are ways to display it on a map. According to the react-native-maps documentation it accepts a geojson as an input. This is exactly what the API/ors-js library returns.