mapbox / mapbox-vision-android

Other
50 stars 43 forks source link

Navigate user via outside custom service array of directions coordinates #268

Closed rgouzal closed 3 years ago

rgouzal commented 3 years ago

I am using in my app my own custom directions api service which gets directions or route of source and destination coordinates. Is there a possible way to navigate depending on custom route coordinates?

yunikkk commented 3 years ago

Hi! Do you try to test it on the road with your custom route information provider? If so - you can map the route to the array of RoutePoints and feed it ti Vision, as shown in https://docs.mapbox.com/android/vision/guides/ar/#route-line.

rgouzal commented 3 years ago

@yunikkk I am getting route coordinates via a different API (openrouteservice.org) so are you saying I have to loop through each coordinate and map it to a routepoints I see that RoutePoint class is final and does not have a setter or getter same with Route class?

yunikkk commented 3 years ago

@yunikkk I am getting route coordinates via a different API (openrouteservice.org) so are you saying I have to loop through each coordinate and map it to a routepoints I see that RoutePoint class is final and does not have a setter or getter same with Route class?

Exactly, you need to map coordinates you retrieve from that API to RoutePoints, similarly to https://docs.mapbox.com/android/vision/examples/basic-ar-navigation/. It's final since it's in fact kotlin data class and you should be able to create and init it with constructor.

rgouzal commented 3 years ago

@yunikkk okay but how can I map it since Route class and RoutePoint class does not have a public setters?

rgouzal commented 3 years ago

@yunikkk and what about a profile of "walking" does AR navigation work only for profile "driving" by lane detection?