Questions tagged [google-directions-api]

The Directions API is a service that calculates directions between locations using an HTTP request. It is also available as part of the client-side Maps JavaScript API, or for server-side use with the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.

With the Directions API, you can:

  • Search for directions for several modes of transportation, including transit, driving, walking or cycling.
  • Return multi-part directions using a series of waypoints.
  • Specify origins, destinations, and waypoints as text strings (e.g. "Chicago, IL" or "Darwin, NT, Australia"), or as latitude/longitude coordinates, or as place IDs.

The API returns the most efficient routes when calculating directions. Travel time is the primary factor optimized, but the API may also take into account other factors such as distance, number of turns and many more when deciding which route is the most efficient.

Note: This service is not designed to respond in real time to user input. For dynamic directions calculations (for example, within a user interface element), consult the documentation for the Maps JavaScript API Directions Service.

This service is also available as part of the client-side Maps JavaScript API, or for server-side use with the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.

523 questions
1
vote
1 answer

How to make synchronous call to google direction api for requesting the services on serverside?

How do I get JSON from google directions api using jQuery? I need to make the requests as "eithel" has mentioned in above link because I am making multiple requests and I need the responses for all and need to continue. If I use requests for…
Punith G
  • 31
  • 6
1
vote
1 answer

Android Google Maps Directions: how to avoid wrong routes, when gps points to the other side of road

I'm developing a gps tracking system that sends it's coordinates to my phone through a server. The only problem with this system is that the gps can't always be precise and it fails a few meters. This means it could point to the opposite side of…
tamasJozsa
  • 86
  • 1
  • 12
1
vote
2 answers

Google Directions API not authorizing access iOS

I am trying to use the Google Directions API without success. I activated the Google Maps SDK for iOS on the developer console and also the Directions API. This is the URL I am…
Jose Luis
  • 3,307
  • 3
  • 36
  • 53
1
vote
1 answer

Altitude in a tunnel or on a bridge

In my web application, I need to know the altitude of a road. For that, I use the Google Maps API v3. I use the Direction Service for getting the waypoints and then I use the Elevation Service to get the altitude of each points that the Direction…
Allan Mermod
  • 806
  • 1
  • 8
  • 16
1
vote
1 answer

Google direction API: not to translate addresses into English

I am trying to use the Google Direction API service. My addresses are in Chinese, not in English. If I enter the URL directly into the browser, Google returns Chinese addresses. However, if I include the URL in a Python program, Google will…
Randy Tang
  • 4,283
  • 12
  • 54
  • 112
1
vote
1 answer

Calculating the best route with different start and end locations

In my app users can choose a number of destinations in a city they would like to visit. At the moment I'm using this to determine the best route beween LocationA and LocationD whilst making sure to go to the best route taking in LocationB and…
1
vote
1 answer

get only city names in the Google Directions API

I am using the Google direction API to get itineraries based on points that can be cities only (not addresses, countries, or any POI). I would like to parse the city name out of the response, but the API return a somewhat cumbersome string that…
Yann
  • 877
  • 14
  • 25
1
vote
1 answer

Google direction API gives wrong distance and time duration

I have implemented the google map api functionality in my android APP. The google map api give me a correct route(Directions), but it gives wrong distance and time between the two endpoint. I have implemented this google map api in android, in XML…
PTech
  • 163
  • 1
  • 11
1
vote
2 answers

Change color of destination waypoint: Google directions service

I am trying to change color of destination waypoint to green from red. Currently following the code from example: Google waypoints I googled, but could not find answer. Many thanks in advance.
1
vote
1 answer

Can't get full body of HttpResponse

I put my code in AsyncTask, in OnPostExecution, the result in Dialog is different from the one which is logged in Logcat. The one in Logcat is incomplete, the one in Dialog is complete Here is my code: private class DownloadTask extends…
1
vote
1 answer

How to lookup coordinates on google maps directions api response?

Is there any api or way of checking if a coordinate or location exist in the returned Direction Api response? https://developers.google.com/maps/documentation/directions/#DirectionsResponses I want to check if the returned Direction Api response…
1
vote
1 answer

Error with the google map calling direction api from android device

I'm using the Google map v2 for android. I would like to call to the directions api to get the points from android device. I registered the Google console key, I can view the map on android. I used this key to include in the directions api call like…
user1597721
  • 313
  • 1
  • 6
  • 14
1
vote
4 answers

Google Directions API Encoded Polyline

I am trying to map routes which should match the Google Maps street network. I know how to serialize the JSON result from the Google Maps Directions API. I am looking now at encoding the polylines from the individual routing steps. I have found some…
Dennis Bauszus
  • 1,624
  • 2
  • 19
  • 44
1
vote
1 answer

Find the direction of a path using Google Direction API

I am using Google Places API and direction API to mark the route between 2 places. I get a polyline for this route. Now I have another polyline which lies on this route. Eg: Point A to point B -> initial polyline Point C to point D -> second…
1
vote
1 answer

Google Directions API error

When I use the following url: http://maps.googleapis.com/maps/api/directions/json?origin=Cais%20do%20Sodre&destination=Gare%20do%20Oriente&sensor=false&mode=transit I'm getting the result { "routes" : [], "status" : "INVALID_REQUEST" } but it…
pedroremedios
  • 763
  • 1
  • 11
  • 39