I am trying to use the distance matrix by using the following:
https://maps.googleapis.com/maps/api/distancematrix/json?units=metrics&origins={x},{y}&destinations={xd},{yd}
Where x,y are latitude and longitude.
When i test it it works fine as seen in the picture
But when i use this in my app it says "not found"
Can any one help me?
Hi Mario,
I found a solution.
Use the following url: https://maps.googleapis.com/maps/api/distancematrix/json?units=metrics&origins={origins}&&destinations={destinations} and make sure the origins and destinations are strings.
The x and y coordinates should be seen as one string and somehow when adding a separate x and y coordinate to build the string in the URL is breaking the functionality.
Let me know if this is the solution for you.
Kind regards,
Remco Dekkinga
Remco Dekkinga wrote:
For the 40,4 and 4,40 it works, but whn i try with my location it gives the same error.
I am passing to the origins input like this
SyntaxEditor Code Snippet
"GetLocation.Location.Latitude,GetLocation.Location.Longitude"
I've tried your REST api (including your key... Try to remove/hide the key to avoid other people from using your private key.) and I just got a successful response status. What are the input values that you tried when calling the REST in your application?
Hi,thanks for your reply.
I tried this input values:
I used the exact same inputs, because you tried them on the initial image too. My flow looks like this.
In the Var1 assignment I assign the Status of the response to a text variable and show this on my screen. It returns "Ok".
Can you share the OML where the error happens?
I also get an ok status there but on the rows elements status i get not found and no distance or duration time.
Do you get a distance or duration time? What is the status of your rows elements?
Thanks for your help
You are correct. It gives a "NOT_FOUND" in the list of distances... Very strange indeed.
Yes it is, i am strugling with this problem for the last three days and tryed everything and cant find the problem
if i use directly https://maps.googleapis.com/maps/api/distancematrix/json?units=metrics&origins=4,40&destinations=4,40 it works but when i try with input parameters it just doesnt work
Dont know what to try more. i need them has input variables so i dont want to put them directly on the url
I've tried it with the following locations:
origins=55.93,-3.118
destinations=50.087,14.421
Somewhere in the UK and in the Czech Republic.
Can you share the locations that are failing?
When i put numbers as you did
it works, but if i try
origins="GetLocation.Location.Latitude,GetLocation.Location.Longitude"
it gives not found
I'm not sure what you are trying to use for the origins, but the origins should be a geolocation in the form of "x,y".
In your case, when you have an action called GetLocation, which returns the Location(Latitude, Longitude) build the origins variable in the following way:
Origins = GetLocation.Location.Latitude + "," + GetLocation.Location.Longitude
If this doesn't work, please share your flow. I can check it with you.
Thanks a lot