Completed
Last Updated: 05 Feb 2018 10:53 by Dimitar
ADMIN
Hristo
Created on: 10 Jan 2018 13:53
Category: Map
Type: Bug Report
0
FIX. RadMap - The BingRestMapProvider should build URIs using invariant culture
How to reproduce: Change the current culture so that a comma is used as a decimal separator, the Elevations example will fail with a (400) Bar Request error.

Workaround: create a custom BingRestMapProvider class
public class CustomBingRestMapProvider : BingRestMapProvider
    {
        protected override string GetPointsString(List<PointG> points)
        {
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < points.Count; i++)
            {
                PointG point = points[i];

                if (i > 0)
                {
                    sb.Append(",");
                }

                sb.Append(point.Latitude.ToString(CultureInfo.InvariantCulture) + "," + point.Longitude.ToString(CultureInfo.InvariantCulture));
            }

            return sb.ToString();
        }
    }
0 comments