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 track route of user between two locations?

I have two Addresses let say Location A and Location B. And I have series of location between those Location A and Location B. I get those series of locations via Fused location API. and saved them on the server. Now following are my requirements…
1
vote
1 answer

How to get the Google Maps directions (route) sharing feature in web application via its Java Script API

I am sorry if this question is not fit for this forum. I want to get the Google Maps directions (route) sharing feature into my web application via Google Maps Java Script API same like Send directions to your phone on Gogle Maps Directions. Is it…
1
vote
1 answer

Error initializing GeoApiContext in Java

After upgrading version 0.2.2 of google-maps-services, trying to do the following: GeoApiContext context = new GeoApiContext.Builder().apiKey("MY KEY").build(); I am getting the error detailed below: Exception in thread "main"…
1
vote
1 answer

android direction api getting exact maneuver that should be displayed

My app should draw the route from current location of device to the destination i want, until now there is no problem, and my app can draw this route by decoding the coordinates in the json file. what i want is the maneuver information in the json…
salman
  • 108
  • 8
1
vote
1 answer

Android Google Direction API, How To Ignore One Way Street

How to make a Google Direction API url that ignores one way street restriction and only go through national streets (big streets)? What parameters I should add? Here's my current code: private String makeURL(double sourcelat, double sourcelog,…
zamroni hamim
  • 545
  • 1
  • 6
  • 21
1
vote
0 answers

Efficiently drawing large distances of Polylines on Google Maps

I am currently trying to draw routes between 2 destinations utilizing requested JSON data from Google's Directions API. The version I currently have works well with destinations within around 150 miles. Yet when I try drawing poly lines across a…
1
vote
1 answer

Not getting full response in swift HTTP request?

I'm using google directions API. When i send the request i'm getting half of the response. This is my code: func getDirections(_ origin: String!, destination: String!, completionHandler: @escaping ((_ status: String, _ success: Bool) -> Void)) { …
1
vote
1 answer

How to generate signature with Google Maps python client?

I did not find any relevant answer on SO. I can't figure out how to use the Google Maps python client with the client id and client secret. The Maps Python lib doc show in its doc how to instantiate and use the client: import googlemaps gmaps =…
laugri
  • 597
  • 6
  • 13
1
vote
1 answer

How to use Java Client Library Google Maps Services for DirectionsApi

I have tried for several days and could not find any example which uses Java Client Library for Google Maps Services for DirectionsApi, I have seen many tutorials where they work on requet response, but I want to use this library because it is…
1
vote
3 answers

Crash on polylineWithPath:path GMSThreadException

I am using this source code to draw route but getting crash on line, polyline = [GMSPolyline polylineWithPath:path]; Terminating app due to uncaught exception 'GMSThreadException', reason: 'All calls to the Google Maps SDK for iOS must be made…
user7840116
1
vote
1 answer

diffrence between distance matrix api and direction api

i want to display route on google map, i know for that direction api is used. further more i want time duration and distance between two points, that is also we can get from direction api. but next step is to calculate location distance and time…
1
vote
1 answer

How to Get distance and duration in Google maps direction api

I am trying to add distance and duration that we get from google maps direction api. I don't much about JSON so please help me to add distance and direction in following code. To distance and direction we have to use JsonObject like following…
1
vote
1 answer

Origin and destination point is not placed precisely on Google Maps SDK

I tried to draw a route with Google Maps on iOS that come from Google Direction API. I hit this end point NSString *urlString = [NSString…
Sonic Master
  • 1,238
  • 2
  • 22
  • 36
1
vote
1 answer

No alternative routes with waypoints

I cannot get alternative routes using DirectionsService.route with provideRouteAlternatives set to true and with several waypoints defined. But nothing in the doc states that it is impossible. So am I just unlucky or do you also experience the same…
1
vote
0 answers

Google Directions response to Google Map URL?

I am using C# to use the Google Web Services - Directions API. Can I use the DirectionsResponse and convert that to a Google URL? Can I then copy it into a web browser to display the result?