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
49
votes
13 answers

How to decode the Google Directions API polylines field into lat long points in Objective-C for iPhone?

I want to draw routes on a map corresponding to directions JSON which I am getting through the Google Directions API: https://developers.google.com/maps/documentation/directions/start I have figured out how to extract the latitude and longitude…
Alan Moore
  • 6,525
  • 6
  • 55
  • 68
40
votes
4 answers

Exceed 23 waypoint per request limit on Google Directions API (Business/Work level)

I would like to use the google directions API to develop route planning software for a company that handles snowplows in the winter and landscaping in the summer. One of the customers requirements is that he be able to calculate routes with at…
Marc H
  • 1,228
  • 3
  • 18
  • 29
34
votes
3 answers

Change Google map marker orientation according path direction

I'd like to know if it possible to change the marker orientation according the path drawn on the map. Here is a example: As you can see the marker is a car (with front bumper and tail lights). I'd like to orientate the car in the direction the path…
maxwell2022
  • 2,818
  • 5
  • 41
  • 60
20
votes
5 answers

Google Directions API

In the JSON output, there is a field "maneuver" within a "step". In this "turn-left", "turn-right", "turn-slight-left", etc. Example is here Where could I find the definition of the "maneuver" field, and the list of possible values? There is no…
user2633218
  • 263
  • 1
  • 2
  • 7
19
votes
5 answers

Call requires API level 26 (current min is 23): java.time.Instant#now

I'm implementing Google's Directions API. My app supports minSdkVersion 23 and java.time.Instant is not supported here. Is there a solution for this, or should i just check for user's version and allow this functionality if it's version is…
Esteban Rincon
  • 2,040
  • 3
  • 27
  • 44
18
votes
9 answers

Google Maps API Version difference

I'm trying to show route between two places, I want to used Google Places API V3 for route steps between two points. Before I was using Old Google Maps API, and following request gives perfect…
15
votes
0 answers

How to find places along the route using google map api?

If you are getting the route using google.maps.DirectionsService() (say from e.g: Reims to Paris). Now, how can we get all places (say if searching hotels, restaurants or gas stations) which can be found on/along this route (later which will be…
Sanju
  • 401
  • 3
  • 7
  • 15
15
votes
1 answer

Directions API on Android

While I was going through this blog, I got confused about using the Directions API on android. Is it possible to integrate the Directions API on the Map? To make it more clear, I am working on an application that would take in inputs from the users …
13
votes
1 answer

Google Directions API limit

i am trying to draw the route between two markers on my google map which i implement in my android app. I have read, the way to do this is invoking the Directions API service. The Usage Limits says you could only make 2500 request per day, i am…
CarlosJavier
  • 1,005
  • 1
  • 16
  • 29
13
votes
4 answers

Is there a way to show road directions in Google Map API v2?

I was looking for an answer using Google and here, and the only relevant posts I have found are: Google Maps Android V2 and Direction API Get driving directions using Google Maps API v2 but there is no answer there. So I have already mentioned it…
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
12
votes
3 answers

Android Google Maps Direction Api - Api key restriction not working

When we are setting a Key restriction to NONE for Google Maps Direction Api, It works fine. But When we set Key restriction to Android apps and provide a proper Package name & SHA-1 certificate - It says Request Declined from Google Api response.…
12
votes
2 answers

Google direction route from current location to known location

I use the MapsActivity class in this project. On my map you can see many markers. I have many known locations, but in my code I just display two locations for example. I don't understand how to use the direction API and JSON. How can I display the…
Newbee
  • 127
  • 1
  • 2
  • 7
12
votes
1 answer

Direction api: check if a place falls in the route path between 2 places

I am using Google Direction API to plot the route path between 2 places A and B. I am able to do this. Now, I have a requirement to check if given a place C falls in the route path of A and B. Here is the snapshot of the route path that I have…
9
votes
1 answer

Why I get this error when on google map "Failed to load DynamiteLoader: java.lang.ClassNotFoundException: Didn't find class?

I am trying to draw path between two latitude,longitude. Here is my MapsActivity.java. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); //…
demo demo
  • 151
  • 2
  • 4
  • 15
9
votes
0 answers

Google Maps Dircetions API - Arrival time?

I use the Google Directions API for calculating the needed time between 2 places. The API gives me an option departure_time, where I can pass the timestamp of the departure time (or "now"). Then the answer is the duration_in_traffic. This is working…
Michael B
  • 1,660
  • 3
  • 28
  • 59
1
2 3
34 35