I was wondering if it was possible to use conditions with JSON. Let me explain, I would like to check a condition when the route indicates to turn left or right. I use mapbox as a navigation SDK.
In their technical documentation, he tells us that we can use StepManeuver
object:
Example:
{
"bearing_before": 299,
"bearing_after": 202,
"type": "turn",
"modifier": "left",
"location": [
13.424671,
52.508812
],
"instruction": "Turn left onto Adalbertstraße"
}
What interests me is the value modifier
which can be associated with "left" or "right".
So I would like to create a condition "if turn left then [...]" and "if turn right then [...]". But I do not know if this is possible and I do not know how to do it, thank you very much for your help.