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
5
votes
1 answer

How can I get directions for multiple waypoints with different transit methods using the Google Directions Service?

So I understand how to use the Google Directions service to add waypoints and to change the transit mode but is it possible to do both with the same API call? I'm trying to get directions that will involve walking, then biking, and then some more…
Dan Goldin
  • 957
  • 13
  • 32
4
votes
1 answer

How to use google directions api for free

I was using Google Directions Api within the limit of 2500 route queries per day which is free. It was working fine. Now out of nowhere it gives this error while requesting the api when it is clearly written in…
Nimra
  • 67
  • 1
  • 1
  • 6
4
votes
1 answer

Difference between duration and duration_in_traffic in Google Directions API Response

After working with the Google Directions API for a project I found multiple responses with a (much) shorter value in duration_in_traffic than duration. An example extract from one of the responses i got: "duration": { "text": "23 mins", …
4
votes
1 answer

Google Maps. Tracking history on the map. Incorrect route because of errors in the coordinates

My app shows the tracking history of the vehicle on Google Map. We receive the location from our mobile app every 2 mins and store it do DB. After that we show the route (using JS API, Directions Service) on the map. { origin: 'Chicago, IL', …
4
votes
1 answer

Google directions api singe source multiple destinations

I have a database with a list of locations and I have to get the route steps, drive distance and drive time for all combinations of locations in the database. I have the latitude and longitude stored in the database for every location. I'm using the…
Chris Serrao
  • 135
  • 2
  • 12
4
votes
2 answers

GoogleMaps : How to draw dash line to connect with starting point of direction path on google map ios

I am using google map in the my project for direction & show route. I had done all things but I am not able to draw the dash line to connect with starting point of route from my location or building. See my app screenshot screenshot 1 Now I want to…
user7609184
4
votes
1 answer

GoogleMaps directions service using ionic-native

I am using googleMaps with my ionic2 app. I am using ionic-native lib.I have implemented a lot of the business so far and now I am trying to find the route between two points using google directions service. But I can't find any sample or where I…
4
votes
0 answers

Google API key security for iOS apps

TLDR: Does Google check the validity of an iOS app's bundle identifier when restricting the API key to a specific iOS app? Or is it possible for anyone to mimic the bundle ID in order to launch an attack? If the latter is false, why not include the…
4
votes
3 answers

Using lat/long of source and destination to get the route via Google Directions API in Python

I simply want to use Google Directions API to get the route/directions from point A to point B, given the lat/long coordinates of A and B. And I want to do this in Python. If I do something like that, it works: import googlemaps gmaps =…
4
votes
1 answer

Google Directions API One Way instead of Origin and Destination

I'm using google's directions API to solve TSP. Is there any way to take advantage of google's route optimization without providing an origin AND destination. For my purposes, I only care to set the origin. The destination can be whatever is best…
4
votes
1 answer

How to make different routes selectable in google Maps in android?

I'm working on an app which uses lots of google maps interaction. In an activity i've show routes between two point. I want those routes to be selectable, as per the user's choice show please help me. Here i'm attatching the image of the activity…
4
votes
2 answers

How to get all transit stations in Google Maps Directions api?

I made a HTTP request to a Google Maps Directions which includes transit step. The transit step in the response only returns object with information about departure and arrival stops and a number of stops in between them (5).
purfufna
  • 101
  • 1
  • 6
4
votes
1 answer

Plot polyline in Google Maps

I'm exploring Google Maps Direction API and noticed I get an overview_polyline -> points result. I was able to enter that value in the "Encoded Polyline" field here: https://developers.google.com/maps/documentation/utilities/polylineutility. The…
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
4
votes
1 answer

Google driving direction on map with way points

I want to display driving path on google map using api v2. I have a source, destination and some way point between those two points. and for this I am using below code and it works fine, but problem is when i have less then 10 points then it works…
4
votes
1 answer

Issue streaming directions for Google Maps API v2 Android

So part of my application builds a navigation directions string and then attempts to parse the JSON and draw the polyline routes on my map. I first build my string using Location variables or Locale constants. I end up with something like…
1 2
3
34 35