The truck does not correctly process commands to go to specific customer due to culture-specfic formatting of the coordinates. GetRouteDirections returns an error message:
The provided coordinates in query are invalid, out of range, or not in the expected format
Current code - depends on CurrentCulture - coordinates are incorrectly formatted as numbers with comma (,) as decimal separator
var req = new RouteRequestDirections
{
Query = $"{currentLat},{currentLon}:{destinationLat},{destinationLon}"
};
Corrected code - depends on InvariantCulture - coordinates are formatted as numbers with dot (.) as decimal separator
var req = new RouteRequestDirections
{
Query = FormattableString.Invariant($"{currentLat},{currentLon}:{destinationLat},{destinationLon}")
};
The truck does not correctly process commands to go to specific customer due to culture-specfic formatting of the coordinates. GetRouteDirections returns an error message:
The provided coordinates in query are invalid, out of range, or not in the expected format
Current code - depends on CurrentCulture - coordinates are incorrectly formatted as numbers with comma (,) as decimal separator
Corrected code - depends on InvariantCulture - coordinates are formatted as numbers with dot (.) as decimal separator