Replies: 0
Hello,
We are started using the Google distance Matrix API to provide live travel times on our WordPress site and it works using your plugin, thanks!
However we have realised, that if we just put the start and end coordinates in (as seen below), Google maps will provide travel times based on diverting off the freeway and back on again.
[jsoncontentimporter url=https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=-33.715859,151.111907&destinations=-32.826261,151.633058&key=apikeyhere&departure_time=now]{subloop-array:rows:1}{subloop-array:rows.elements:1}{subloop:rows.elements.duration_in_traffic:1}{rows.elements.duration_in_traffic.text}{/subloop:rows.elements.duration_in_traffic}{/subloop-array:rows.elements}{/subloop-array:rows} [/jsoncontentimporter]
We want to provide true travel times if motorists are stuck on the freeway with no diversions so therefore we need to add up the time between exits (with no opportunity to divert)
Can someone tell me how I can use this plugin to;
(1) Make multiple API calls, one between each exit.
(2) Add up all results in seconds
(3) Convert seconds to hours / minutes
Thanks!!