new Directions(options)
Creates a directions object with options you provide.
Declaration
constructor(options?: DirectionsConstructorOptions);Parameters
- options:
An object containing the options for creating a directions object. This parameter is optional.
Discussion
To request directions, create an instance of the Directions object, then call the route(request, callback) function with a DirectionsRequest object as the first parameter. The second parameter for route(request, callback) is a callback function, through which MapKit JS returns the directions response asynchronously.
To return directions in a specific language, set language in DirectionsConstructorOptions when you create an instance of the Directions object.