Structure

DirectionsRequest

The requested start and end points for a route, as well as the planned mode of transportation.

Declaration

dictionary DirectionsRequest {
    String|mapkit.Coordinate|Place origin;
    String|mapkit.Coordinate|Place destination;
    mapkit.Directions.Transport transportType;
    Boolean requestsAlternateRoutes;
};

Overview

Provide a DirectionsRequest object to the route method to get directions between two points, as shown in the code listing that follows. origin and destination are required.

var myDirections = new mapkit.Directions();
myDirections.route({ 
  origin: "San Francisco, CA", 
  destination: "Oakland, CA", 
  transportType: mapkit.Directions.Transport.Automobile }, 
  function(error, data) { 
    // Results are returned asynchronously via this callback function, in `data`
  } 
);

Topics

Directions Request

origin

The start point for routing directions.

destination

The end point for routing directions.

requestsAlternateRoutes

A Boolean value that indicates whether the server should return multiple routes when they are available.

transportType

The mode of transportation to which directions should apply.

mapkit.Directions.Transport

The modes of transportation.

See Also

Getting Directions

route

Retrieves directions and estimated travel time based on the specified start and end points.

DirectionsResponse

The directions and estimated travel time returned for a route.

Route

Information about a route, including step-by-step instructions, distance, and estimated travel time.

RouteStep

A single route between a requested start and end point.