I'm trying to create my custom Route with MapBox and add a list of customs steps. To draw a route from a list of Point, I'm using MapboxMapMatching. From MapBox documentation, I understand that steps are managed by LegStep but I can't houw I add my custom Steps if it is possible ?
Asked
Active
Viewed 131 times
1 Answers
1
It sounds like you're looking for "Milestones", which are included in the Android Navigation SDK out of the box. Per the linked documentation, you can add custom milestones with an explicit method call:
navigation.addMilestone(new RouteMilestone.Builder()
.setIdentifier("begin-route-milestone")
.setTrigger(
Trigger.all(
Trigger.lt(TriggerProperty.STEP_INDEX, 3),
Trigger.gt(TriggerProperty.STEP_DISTANCE_TOTAL_METERS, 200)))
.build()

riastrad
- 1,624
- 10
- 22
-
1Thanks riastrad! Yeah we need a more clear definition of "custom steps" in this case. What kind of custom behavior are you trying to achieve? – Dan Nesfeder Feb 14 '19 at 15:34