bing Web サービスを使用して、2 つの場所間の最短ルートを検索しています。
しかし、私はこの奇妙なエラーを受け取ります:
public imagine_cup.RoutingService.RouteResponse EndCalculateRoute(System.IAsyncResult result) {
object[] _args = new object[0];
imagine_cup.RoutingService.RouteResponse _result = ((imagine_cup.RoutingService.RouteResponse)(base.EndInvoke("CalculateRoute", _args, result))); //error in this line
return _result;
}
エラーは、それがサーバーエラーであることを示しています。
これが私のコードです:
public void CalculateRoute(List<Pushpin> wayPoints)
{
// Set the credentials.
routeService.RouteRequest routeRequest = new routeService.RouteRequest();
routeRequest.Credentials = new Credentials();
routeRequest.Credentials.ApplicationId = _applicationId;
// Return the route points so the route can be drawn.
routeRequest.Options = new routeService.RouteOptions();
routeRequest.Options.RoutePathType = routeService.RoutePathType.Points;
// Set the waypoints of the route to be calculated using the Geocode Service results stored in the geocodeResults variable.
routeRequest.Waypoints = new System.Collections.ObjectModel.ObservableCollection<routeService.Waypoint>();
//Adding way points
foreach (Pushpin ps in wayPoints)
{
routeRequest.Waypoints.Add(PushpinToWaypoint(ps));
}
// Make the CalculateRoute asnychronous request.
_routeService.CalculateRouteAsync(routeRequest);
}
bing maps キーを更新したので、古いキーではありません