BingRestMapProvider.CalculateRouteAsync always returns status code 400

1 Answer 50 Views
Map
Dmytro
Top achievements
Rank 1
Iron
Dmytro asked on 09 Jun 2023, 08:37 AM

Hello. I faced the problem when i am trying to get Route from BinRestMapProvider, using method CalculateRouteAsync, it returns status code 400 and message like this: "This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["One or more parameters are not valid.","waypoint: One or more locations specified in the waypoint parameter are invalid or require more information. : 42,6957539183824;23,3327663758679"],"resourceSets":[],"statusCode":400,"statusDescription":"Bad Request" "

I just followed the example at:
https://docs.telerik.com/devtools/wpf/controls/radmap/features/providers/bing-rest-map-provider/routing

I guess problem is in example 4 of this doc: "request.Waypoints.Add(point.ToString());"

I hope someone can help me with it.

Dmytro
Top achievements
Rank 1
Iron
commented on 09 Jun 2023, 09:09 AM

The problem was solved by passing the CultureInfo.InvariantCulture parameter to ToString() - request.Waypoints.Add(point.ToString(CultureInfo.InvariantCulture));

1 Answer, 1 is accepted

Sort by
0
Accepted
Dmytro
Top achievements
Rank 1
Iron
answered on 09 Jun 2023, 09:10 AM
The problem was solved by passing the CultureInfo.InvariantCulture parameter to ToString() - request.Waypoints.Add(point.ToString(CultureInfo.InvariantCulture));
Tags
Map
Asked by
Dmytro
Top achievements
Rank 1
Iron
Answers by
Dmytro
Top achievements
Rank 1
Iron
Share this question
or