mapbox-navigation-ios icon indicating copy to clipboard operation
mapbox-navigation-ios copied to clipboard

Set or change legIndex of RouteProgress

Open faliinitse opened this issue 3 years ago • 0 comments

I want to change the legIndex of RouteProgress After it initializes in RouteController. I found that legIndex in RouteProgress is public but even if i set it then func updateIndexes(status: NavigationStatus, progress: RouteProgress) method in RouteController revert it back to whatever coming in status.legIndex.

I can also see that in the init(route: Route, options: RouteOptions, legIndex: Int = 0, spokenInstructionIndex: Int = 0) of RouteProgress there is an extra parameter legIndex but I can't pass it from anywhere. Can any one help me with this issue?

I want to update the RouteProgress legIndex manually . Right now it is starting the progress from 0 legIndex. I want to set it by myself so it should calculate or give me the correct progress.

I found this Link but this solution only give option to go in a loop I want to set the x index directly and don't want to go in a loop because this method is a Async method.

In the above link it is refer to a method call public func advanceLegIndex(completionHandler: AdvanceLegCompletionHandler? = nil) but i can see that method is calling private func updateRouteLeg(to value: Int, completionHandler: AdvanceLegCompletionHandler? = nil) so instead of advanceLegIndex if you make the updateRouteLeg public then this issue will be resolve.

Thanks in advance

faliinitse avatar Sep 22 '22 06:09 faliinitse