RouteMatrix using Lat/Long values

4 posts / 0 new
Last post
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.[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?


I removed an extra } and it
I removed an extra } and it worked great.{locations:[{latLng:{lat:40.3612,lng:-76.794}},{latLng:{lat:40.3021,lng:-76.9463}}]}&allToAll=true


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?

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{locations:[{latLng:{lat:40.3612,lng:-76.794}},{latLng:{lat:40.3021,lng:-76.9463}}],options:{allToAll:true}}