GoogleMapsAPI.NET
GoogleMapsAPI.NET copied to clipboard
Using the Directions API with GeoCoordinatesLocation fails in Swedish locale
In the Swedish locale, floating point numbers use ',' rather than '.'
That means that in the following code from Converter.cs, dots will be replaced by commas, which messes up the URL, and hence NOT_FOUND is returned from Google. Suggest using InvariantCulture or similar.
// Geo coordinates location
if (locationType.InheritsOrImplements(typeof (IGeoCoordinatesLocation)))
{
var coordinates = (IGeoCoordinatesLocation) location;
return $"{coordinates.Latitude},{coordinates.Longitude}";
}