I have tried to receive the distance and duration from outside the GetDirection mehthod by calling the following code after Get Direction was executed.
Directions.GetDirections(ActiveMarker.Coordinate.ToRec, NewMarker.Coordinate.ToRec);
for I := 0 to Directions.DirectionsRequests.Count-1 do
for II := 0 to Directions.DirectionsRequests.Items[I].Items.Count-1 do
showmessage('I='+I.ToString+'/II='+II.ToString+' - '+Directions.DirectionsRequests.Items[i].Items[II].Distance.ToString);
I thought I would get, every distance for every single Route, but the Length of the Routes can never be right is there some Sort of Indexfailure or something.
I am using Mapbox for every Service.
But that was my Question. So it is not posible to get that Information outside the GetDirection Method?
The OnGetDirection Method is Fired and inside that method erverithing that gets returned seams valid. Outside the Method it behave "strange". Is it because of asynchron execution? Is there a Way to prevent that?
GetDirections is an asynchronous method by design. Accessing the DirectionsRequests data before the OnGetDirections event was triggered will produce unexpected results.