Questions tagged [google-distancematrix-api]

The Google Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations

The Google Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations. The information returned is based on the recommended route between start and end points, as calculated by the Google Maps API, and consists of rows containing duration and distance values for each pair.

This service does not return detailed route information. Route information can be obtained by passing the desired single origin and destination to the Directions API.

Official Documentation

395 questions
3
votes
1 answer

Not able to access value of variable derived from google distance matrix function

I am using Google distance matrix api to get the distance between two locations. I declared a variable globally. Changed this variable in function. But as per normal circumstances I should be able to access this changed value of variable after…
3
votes
2 answers

Google Distance Matrix API returns 'ZERO_RESULTS'

Google Distance Matrix API keep returning 'ZERO_RESULTS'. I checked my request twice and couldn't find any problem, pls help. This is my request…
Bingzi Li
  • 51
  • 1
  • 6
3
votes
1 answer

How implements the Google Distance/Matrix Api at Android Studio?

I'm programming an app that calculates, in route, two locations. I've implemented the google places API to get the lat/lon based on name or address but I can't implement the Distance API. The classes/methods don't appear when I try to import. Below…
3
votes
0 answers

Is there a way to achieve something similar to Google Maps Distance Matrix API using React Native Maps?

Is there a way to achieve something similar to Google Maps Distance Matrix API using React Native Maps? I need to calculate the distance between 2 markers (or chain 3+ different markers). The Google Maps Distance Matrix API is able to calculate the…
3
votes
1 answer

Google Distance Matrix API call not working in particular Server

I have been struggling a lot to fix an issue related with Google distance matrix API call. Please the below code which I use to calculated distance between two calls. It work perfectly fine in localhost and one website hosted in…
HeroCode
  • 31
  • 2
3
votes
3 answers

Calculate the total travelled distance Google Maps API V3 in Android

Till now, I have inserted all the sets of latitude and longitude in my database after every 5 sec from the path I have travelled. Now after reaching the destination I have to calculate the distance from the sets of Latitude, longitude. It's not…
Nilabja
  • 4,206
  • 5
  • 27
  • 45
3
votes
1 answer

Can an Android-App-Restricted API key be used for Google Distance Matrix?

I enabled Google Distance Matrix API and restricted the key for Android Apps because I will be sending http queries from my android app to receive json response: Without restriction, it works and I get expected result. But when it's restricted…
Alaa M.
  • 4,961
  • 10
  • 54
  • 95
3
votes
1 answer

R code to iterate through dataframe rows for google maps distance queries

I'm looking for some assistance in writing some R code to iterate through rows in a dataframe and pass the values in each row to a function and print the output either to an excel file, txt file or just in the console. The purpose of this is to…
macsmith
  • 193
  • 10
3
votes
2 answers

How to return distance in "Km" using Google Distance Matrix API?

I am using Google's Distance matrix API for Java. I have properly working code but I want it to return distance between two latitude-longitude points (origin, destination) in Kilometers. But there's no such method or parameter that it takes to…
jarvo69
  • 7,908
  • 2
  • 18
  • 28
3
votes
0 answers

Why Google direction and distance matrix API show different results for source and destination value

I am trying to get distance and duration using google direction API https://maps.googleapis.com/maps/api/directions/json?origins=latitude,longitude&destinations=latitude,longitude&&mode=driving&key=xxxxxxxxxxxxxxxxxxxxx and its working fine and get…
Rgv
  • 504
  • 5
  • 23
3
votes
1 answer

Google DistanceMatrix API

I'm trying to get the direction_in_traffic, which isn't returned using the regular directions api. I've found that there is a field in the distancematrix api that does just that. This code works when I run it from my own machine, but once it is…
Haroen Viaene
  • 1,329
  • 18
  • 33
3
votes
2 answers

Finding distance using place id

As per the documentation, we retrieve the distance between a set of origins and destinations in the following manner (Server…
user3506
  • 31
  • 1
  • 3
2
votes
4 answers

How can I use Google Map's distance matrix API in flutter. Can anyone help me

I am making my final year project and I am stuck in distance matrix. I am making an app in which I am using google maps, but I don't know how to find the time and distance between two places. I read some articles but can't understand I am beginner…
2
votes
1 answer

Issue with Google Distance Matrix URL while making off-browser requests

https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=Neuh%C3%B6fer+Damm+110,Germany&destinations=Vogelweide+8,Hamburg&key=YOUR_API_KEY The API Key is having the distance matrix API linked to it. If you use your own key, you…