RouteMatrix using Lat/Long values

4 posts / 0 new
Last post
appssoco
RouteMatrix using Lat/Long values

I am trying to use Route Matrix API by passing set of Lat/Long coordinates but not getting any success. Here is my sample URL. 

http://www.mapquestapi.com/directions/v2/routematrix?key=[OUR COMPANY KEY GOES HERE, I KNOW]&json={locations:[{latLng:{lat:40.3612,lng:-76.794}},{latLng:{lat:40.3021,lng:-76.9463}}}]}&allToAll=true

Can you please help me with the correct calling syntax for using lat/long with this API?

Thanks


MQBrianCoakley
I removed an extra } and it
I removed an extra } and it worked great.   http://www.mapquestapi.com/directions/v2/routematrix?key=KEY&json={locations:[{latLng:{lat:40.3612,lng:-76.794}},{latLng:{lat:40.3021,lng:-76.9463}}]}&allToAll=true

ranjitha
Issue

I tried using the query, but it returned just a vector for "distance" and "time" with alltoAll set to false (although alltoAll is set to true in the query). Is there some problem with the way I am using it? Isnt it supposed to return matrices?


MQBrianCoakley
Sorry, I didn't think to
Sorry, I didn't think to correct the allToAll parameter. With json input the options need to be part of the json. So the request would look like   http://www.mapquestapi.com/directions/v2/routematrix?key=KEYjson={locations:[{latLng:{lat:40.3612,lng:-76.794}},{latLng:{lat:40.3021,lng:-76.9463}}],options:{allToAll:true}}