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

Google Directions API and traffic-based rerouting

I was wondering if Google Directions API automatically reroutes if traffic is heavy on a route like Google Maps itself does, or if it will always return the same route, regardless of traffic? If it does reroute, is there a way to force it to always…
Matthias Grün
  • 1,466
  • 1
  • 7
  • 12
1
vote
1 answer

Implementing turn by turn navigation in Android using Mapbox SDK

I am trying to implement turn by turn feature into my app using Mapbox Android SDK. Although Mapbox has Drive listed as their product I am not able to find any documentation/examples on how to use it (maybe their are still working on it). Anyways,…
ik024
  • 3,566
  • 7
  • 38
  • 61
1
vote
1 answer

How to make my Google Map follow the user at all times and not let them scroll away

I have a GMSMapView connected to my mapView variable. It is all set up and even puts a random polyline on the map for the user. Currently I have a "navigate" button but all it does is zoom in on the user. I would like to make it so once they hit…
skyleguy
  • 979
  • 3
  • 19
  • 35
1
vote
0 answers

Using google api for search results in database

I have a database table where I save Google's placeID 1 as the origin and placeID 2 as the destination. Later on, I use these fields from my database to pass them to Google's Directions API in order to represent a trip. My question is when a user…
1
vote
1 answer

Google Maps Directions API - displaying alternate routes on button click

how do I change the currently displayed route on a Google map on button click? Currently I am able to show only the primary route that is being returned. I am also able to loop through all the routes that was returned by the API. I just can't seem…
1
vote
2 answers

Swift Google Directions API JSON - EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

I am trying to get directions data using Google API, but it's keep crashing. Here is my code: let baseURLDirections = "https://maps.googleapis.com/maps/api/directions/json?" var selectedRoute: Dictionary! var overviewPolyline:…
S. Park
  • 139
  • 1
  • 2
  • 9
1
vote
1 answer

Move marker along with road or on the ployline on Google Map

I am trying to track location of the vehicle but facing the issue that marker is not animated along with the road. I am using Google direction API for that.My polyline and marker is placed properly on the road but when i move the marker it is not…
1
vote
0 answers

Can't View Usage Quota for Google API

I am currently implementing Google Maps and Google Directions in my iOS application, and I want to be able to view my usage/quotas, but in my Google Developer Console, when I go to overview, all the statistics say that I have made 0 request, even…
1
vote
1 answer

How can use more of 23 waypoints with a single request in google directions API (premium account)?

is there a legal/straight possibility to use more of 23 waypoints in a single request to google maps api directions? We have to change our plan? How and what? We've a premium account and we need to use directions to make a call with more of 23…
1
vote
2 answers

Calculate distance between same start destination and end destination

How do you get distance between multiple latitudes and longitudes from a encoded polyline. Currenly the Direction API calculates the distance between origin and destination. But I also want to be able to calculate the distance whenthe origin…
Rasmus Rajje Josefsson
  • 1,564
  • 2
  • 15
  • 33
1
vote
1 answer

GoogleMaps iOS - Getting straight line instead of a route

I am using GoogleMaps directions for my iOS app to show a route between my current location and the selected place. For this I use a polyline, the problem is that it draws a straight line instead of a route. Can anyone help with this?
1
vote
1 answer

Android: Getting journey duration as per live traffic

I wanted to show journey duration to a particular location with live traffic and without traffic. How can this be achieved in an android app?
Aditya Borde
  • 1,227
  • 2
  • 12
  • 31
1
vote
1 answer

Google directions' URL returning "ZERO RESULTS"

I've followed this tutorial - https://www.youtube.com/watch?v=AdV7bCWuDYg Trying to draw route on map and I do successfully send latitude/longitude of origin/destination. The problem is its generated URL. I keep getting…
popote
  • 13
  • 3
1
vote
2 answers

Avoid some coordinates in routes using Google Directions API Android

I want to avoid some coordinates while using directions APIs.I have read the below blog https://code.google.com/p/gmaps-api-issues/issues/detail?id=214 Which ensures that Directions API doesn't allow if I want to avoid specific coordinate. Then I…
Jai
  • 1,974
  • 2
  • 22
  • 42
1
vote
1 answer

Using the Google Direction API with multiple waypoints and modes

I have a set of bicycle station and i need to find a way from one point to another, using these bicycles. for example: User go to a nearby station and pick a bicycle he goes to another station bicycling he drops his bicycle here and finish is…
Jean Bouvattier
  • 303
  • 3
  • 19