-1

i am tryiing to pass parameters in bing map distance matrix api with request.get(url,parameter) but it is not passing in correct order

i tried this

enter code here

parameters = {
'origins':[47.6044,-122.3345],
'destinations':{"latitude":47.6731,"longitude":-122.2057},
"travelMode": "driving",
'key':api_for_bing
}

but it gives the response :

'https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=47.6044&origins=-122.3345&destinations=latitude&destinations=longitude&travelMode=driving&key=my_key'

can any one help me with this.

while it shoud be like this

'https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=47.6044,-122.3345;47.6731,-122.1185;47.6149,-122.1936&destinations=47.4747,-122.2057&travelMode=driving&key=my_key'

1 Answers1

0

First, you probably want to hide your personal Bing Maps Key. Second, there are sample calls available at https://learn.microsoft.com/en-us/bingmaps/rest-services/examples/distance-matrix-example

Your call above only shows one start and one destination which is not actually a matrix but rather just a single route. If you are not actually looking for multiple routes then you probably should use the Routing API (Directions Manager)rather than Distance Matrix.

  • 2
    Note: This question was answered on MSDN at https://social.msdn.microsoft.com/Forums/en-US/04269b9c-18bc-4f07-b8ca-176fd60060e0/parameter-passing-for-distance-matrix-api?forum=bingmapsservices –  Apr 01 '19 at 23:27