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
0
votes
2 answers

Get Directions to a Google Maps Marker

I'm trying to get directions to a Google Maps Marker position from a postcode that a user can enter in a textbox. I'm using the Maps, Places and Directions Google Libraries. I've found this example from google and I'm trying to work from it…
0
votes
0 answers

How to Generate Route Between more than two Locations(way points) in Google Map in Android?

Draw a poly for two locations is fine and with the help of waypoints response it will be drawn only for first waypoint. Could you please help me out With the help of the Google Maps API response with waypoints I want to draw a route on google maps…
0
votes
0 answers

google directions api always returning empty route

I'm trying to make use of the directions api to draw route on map. I created the interface below so I can call the getRoutes() Function inside the interface in the mainactivity and access texts from edittexts and pass them as the origin and…
0
votes
0 answers

google directions api returning zero routes

I'm trying to make use of the directions api to draw route on map. I created the interface below so I can call the getRoutes() Function inside the interface in the mainactivity and access texts from edittexts and pass them as the origin and…
0
votes
0 answers

How can I extract only a part of the road rather than analysing the whole road using GoogleMaps API?

I am using GoogleMaps Directions API to extract the main road one can take from origin to destination as an output. Origin: Stuttgart, Germany Destination: Frankfurt, Germany Output: ['A6'] The function get_route_segment() extracts the list of main…
0
votes
1 answer

How do I mention only the major highways as output rather than local roads?

I am using Directions API to get a route segment (list of destinations to reach a particular destination). origin = "New York" destination = "Ohio" output: ['2 Murray Street, New York, NY 10007, USA', '50 14th St, Jersey City, NJ 07310, USA', '5710…
0
votes
0 answers

Update polyline in flutter as google does it in Google Maps App

Current, i'm implement tracking + navigation to specific point by updating polyline on change of current location. this process is very costly because it calling direction Api on every new location. I want to update polyline by calling one time…
0
votes
1 answer

main polyline is not being selected on created map

I'm trying to create a simple program where I can display all the available paths from one point to another using google maps and let the user select any one of the path generated. I wrote a code for that whereas, the alternate polyline paths are…
0
votes
0 answers

I am using google directions api to draw a route on map, it is working fine in chrome but taking very long time to response in android app

I am using google directions api to draw a route on map, it is working fine in chrome but taking very long time to response in android app i am using directions api url to get response, it was working fine when i have integrated it 2 days before…
0
votes
0 answers

Polyline in react native

I am newbie to react native, and I have this problem in polyline in react native. Im using android only. In our realtime database, we have ADMIN Collection , the datas are information about admin and its store. So store have latlong properties. so I…
0
votes
0 answers

Recieve IllegalStateException when I try to build GeoApiContext to get polyline for my maps

I am trying to display the distance between two points as a polyline on the google maps in my app. For some reason this line of code keeps giving me the same exception which causes my app to crash at run time after my main activity is displayed &…
0
votes
2 answers

How to return "waypoint_order" in Google Routes API?

I'm developing a system to trace a route using the Google Routes API. https://developers.google.com/maps/documentation/routes/intermed_waypoints I have the origin and destination points and between these points there are some points of interest.…
0
votes
0 answers

Android directions api not working after putting google key application restriction for android

We have created the google credential key, which we are using for maps as well as directions. When we are setting a Application restriction to NONE for Google Maps Direction Api just works fine. But When we set Application restriction to Android…
0
votes
0 answers

can't decode lat/lng in flutter_google_map(flutter_polyline_points)

this is example code in pub.dev import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:flutter_polyline_points/flutter_polyline_points.dart'; void main() => runApp(MyApp()); class…
0
votes
0 answers

onFailure: timeout after making 1 or 2 direction requests

I'm trying to make an app with places and directions I have done that but after 1 or 2 direction calls I just get onFailure: timeout and nothing shows on the screen. I am using firebase for markers but that's not the issue also the marker changes to…