Module google_maps::directions

source ·
Expand description

The Directions API is a service that calculates directions between locations. You can search for directions for several modes of transportation, including transit, driving, walking, or cycling.

§Get Started

§Start coding with our client libraries

Client libraries make developing with the Google Maps web service APIs easier by providing simple, native implementations of common tasks, such as authentication, request throttling and automatic retry. The Directions API is available in the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.

§Authentication, quotas, pricing, and policies

§Activate the API and get an API key

To use the Directions API, you must first activate the API in the Google Cloud Platform Console and obtain the proper authentication credentials. You need to provide an API key in each request (or a client ID if you have a Premium Plan.

Click the button below to flow through a process where you will:

  1. Create or select a project
  2. Enable the API
  3. Get an API key

Get Started

Learn more about authentication credentials.

§Quotas and pricing

Review the usage and billing page for details on the quotas and pricing set for the Directions API.

§Policies

Use of the Directions API must be in accordance with the API policies.

From our Terms of Service: Innovate, but don’t duplicate. Don’t make a substitute for Google Maps. If your app’s primary purpose is navigation, a business directory, or a general purpose “maps app”, it’s a substitute for Google Maps. Learn more.

§Learn more

There’s more you can do with the Directions API, like requesting directions via different travel modes, using waypoints to calculate routes through additional locations, and estimating travel time. See the Directions API developer guide for more examples and other details.

The Directions API developer guide is intended for website and mobile developers who want to compute direction data within maps provided by one of the Google Maps APIs. It provides an introduction to using the API and reference material on the available parameters.

Re-exports§

  • pub use crate::directions::request::avoid::Avoid;
  • pub use crate::directions::request::departure_time::DepartureTime;
  • pub use crate::directions::request::location::Location;
  • pub use crate::directions::request::traffic_model::TrafficModel;
  • pub use crate::directions::request::transit_mode::TransitMode;
  • pub use crate::directions::request::transit_route_preference::TransitRoutePreference;
  • pub use crate::directions::request::unit_system::UnitSystem;
  • pub use crate::directions::request::waypoint::Waypoint;
  • pub use crate::directions::request::Request as DirectionsRequest;
  • pub use crate::directions::response::directions_distance::DirectionsDistance;
  • pub use crate::directions::response::directions_duration::DirectionsDuration;
  • pub use crate::directions::response::driving_maneuver::DrivingManeuver;
  • pub use crate::directions::response::leg::Leg;
  • pub use crate::directions::response::overview_polyline::OverviewPolyline;
  • pub use crate::directions::response::polyline::Polyline;
  • pub use crate::directions::response::route::Route;
  • pub use crate::directions::response::status::Status as DirectionsStatus;
  • pub use crate::directions::response::step::Step;
  • pub use crate::directions::response::transit_agency::TransitAgency;
  • pub use crate::directions::response::transit_currency::TransitCurrency;
  • pub use crate::directions::response::transit_details::TransitDetails;
  • pub use crate::directions::response::transit_fare::TransitFare;
  • pub use crate::directions::response::transit_line::TransitLine;
  • pub use crate::directions::response::transit_stop::TransitStop;
  • pub use crate::directions::response::transit_time::TransitTime;
  • pub use crate::directions::response::transit_vehicle::TransitVehicle;
  • pub use crate::directions::response::Response as DirectionsResponse;
  • pub use crate::directions::travel_mode::TravelMode;
  • pub use crate::directions::vehicle_type::VehicleType;

Modules§

  • Directions API error types and error messages.
  • Look in this module for documentation on building your Directions API query. In particular, look at the Request struct for examples of the builder pattern. This module contains the tools (enums, structs, methods) for building your Google Maps Platform request.
  • Resources (enums, structs) for processing the Directions API response from the Google Maps Platform. Look in here for more information about the data returned from Google’s server and how to parse it with your program.
  • Contains the TravelMode enum and its associated traits. It specifies the mode of transportation.
  • Contains the VehicleType enum and its associated traits. It specifies the mode of transportation for transit directions.