BingMapsRESTToolkit-SnapToRoadRequest返回BingMapsRESTToolkit.Route

时间:2019-06-27 12:57:15

标签: c# bing-maps

在邮递员中发出请求时,得到的响应包含一个带有回调URL的RouteProxyAsyncResult:

        "resources": [
            {
                "__type": "RouteProxyAsyncResult:http://schemas.microsoft.com/search/local/ws/rest/v1",
                "callbackInSeconds": 3,
                "callbackUrl": "https://dev.virtualearth.net/REST/v1/Routes/SnapToRoadAsyncCallback?.....",
                "errorMessage": "Request accepted",
                "isAccepted": true,
                "isCompleted": false,
                "requestId": "XXXXX"
            }
        ]

然后我可以获取RequestURL,然后获取SnapToRoadResponse。

当我如下使用BingMapsRESTToolkit SnapToRoadRequest时:

        SnapToRoadRequest r = new SnapToRoadRequest()
        {
            Points = Coordinates,
            IncludeSpeedLimit = true,
            IncludeTruckSpeedLimit = true,
            Interpolate = true,
            SpeedUnit = SpeedUnitType.MPH,
            TravelMode = TravelModeType.Driving,
            BingMapsKey = bingMapsKey
        };
        Response response = await r.Execute();

如果金额为100或以下,我会收到SnapToRoadResponse的响应,但是如果金额大于100,则会得到以下信息:

[0] {BingMapsRESTToolkit.Route} BingMapsRESTToolkit.Resource {BingMapsRESTToolkit.Route}

我想从中获得SnapToRoadResponseBingMapsRESTToolkit.AsyncStatus,所以我可以从中获得SnapToRoadResponse。如何阻止它发回Route对象?

0 个答案:

没有答案