Packagecom.google.maps.interfaces
Interfacepublic interface IDirections extends IWrappableEventDispatcher, flash.events.IEventDispatcher, IWrappable
ImplementorsDirections

IDirections is the interface implemented by a Directions object. A Directions object communicates with Google servers to obtain directions between two or more waypoints. Responses to such requests contain an encoded polyline representing the directions, and HTML-formatted steps to take.



Public Properties
 PropertyDefined by
  bounds : LatLngBounds
[read-only] The bounding box for the result of this directions query.
IDirections
  copyrightsHtml : String
[read-only] An HTML string containing the copyright information for this result.
IDirections
  distance : Number
[read-only] The total distance of this entire directions request in meters.
IDirections
  distanceHtml : String
[read-only] The total distance of this entire directions request in a localized string representation in the units that are predominant in the starting country of this set of directions.
IDirections
  duration : Number
[read-only] The total time of this entire directions request in seconds.
IDirections
  durationHtml : String
[read-only] The total time of this entire directions request in a localized string representation.
IDirections
 InheritedinterfaceChain : Array
List of interfaces for wrapping this object.
IWrappable
  numGeocodes : uint
[read-only] The number of geocoded entries available in the result.
IDirections
  numRoutes : uint
[read-only] The number of routes available in the result.
IDirections
  status : uint
[read-only] The status code of the directions request.
IDirections
  summaryHtml : String
[read-only] An HTML snippet containing a summary of the distance and time for this entire directions request.
IDirections
 Inheritedwrapper : Object
Instance of the cross-domain wrapper for this object.
IWrappable
Public Methods
 MethodDefined by
  
clear():void
Clears any existing directions results and cancels any pending load() requests.
IDirections
  
Create the Polyline object associated with the entire directions response.
IDirections
 Inherited
Retrieves the base event dispatcher object that allows access to event dispatching capability for cross-domain objects.
IWrappableEventDispatcher
  
Return the geocoded result for the ith waypoint.
IDirections
  
Retrieves the directions object's options.
IDirections
  
getRoute(i:uint):Route
Return the Route object for the ith route in the response.
IDirections
  
load(query:String):void
Initiates a directions request.
IDirections
  
Updates the directions options.
IDirections
Property detail
boundsproperty
bounds:LatLngBounds  [read-only]

The bounding box for the result of this directions query. This is will be null if no successful result is available.

Implementation
    public function get bounds():LatLngBounds
copyrightsHtmlproperty 
copyrightsHtml:String  [read-only]

An HTML string containing the copyright information for this result.

Implementation
    public function get copyrightsHtml():String
distanceproperty 
distance:Number  [read-only]

The total distance of this entire directions request in meters.

Implementation
    public function get distance():Number
distanceHtmlproperty 
distanceHtml:String  [read-only]

The total distance of this entire directions request in a localized string representation in the units that are predominant in the starting country of this set of directions.

Implementation
    public function get distanceHtml():String
durationproperty 
duration:Number  [read-only]

The total time of this entire directions request in seconds.

Implementation
    public function get duration():Number
durationHtmlproperty 
durationHtml:String  [read-only]

The total time of this entire directions request in a localized string representation.

Implementation
    public function get durationHtml():String
numGeocodesproperty 
numGeocodes:uint  [read-only]

The number of geocoded entries available in the result. For a successful query, this should be equal to the total number of input waypoints. When no results are available (either because no query was issued or because the previous query was unsuccessful), this will be 0.

Implementation
    public function get numGeocodes():uint
numRoutesproperty 
numRoutes:uint  [read-only]

The number of routes available in the result. For a successful query, this should be the total number of input waypoints minus 1. When no results are available (either because no query was issued or because the previous query was unsuccessful), this will be 0.

Implementation
    public function get numRoutes():uint
statusproperty 
status:uint  [read-only]

The status code of the directions request. This will be 500 if no result is available.

Implementation
    public function get status():uint
summaryHtmlproperty 
summaryHtml:String  [read-only]

An HTML snippet containing a summary of the distance and time for this entire directions request.

Implementation
    public function get summaryHtml():String
Method detail
clear()method
public function clear():void

Clears any existing directions results and cancels any pending load() requests.

createPolyline()method 
public function createPolyline(options:PolylineOptions = null):IPolyline

Create the Polyline object associated with the entire directions response. Note that there is a single polyline that represents all routes in the response. This object can be created only after the directions results have been loaded (i.e. the "load" event has been triggered).

Parameters
options:PolylineOptions (default = null) — Options for the creation of the polyline.

Returns
IPolyline — The Polyline object that represents the directions requested.

See also

com.google.maps.services.Polyline
getGeocode()method 
public function getGeocode(i:uint):Placemark

Return the geocoded result for the ith waypoint.

Parameters
i:uint — The index of the geocoded result to return. This should be in the range 0 to numGeocodes - 1, inclusive.

Returns
Placemark — The Placemark object representing the ith geocoded result in the response.

See also

getOptions()method 
public function getOptions():DirectionsOptions

Retrieves the directions object's options. Use the setOptions() method to modify directions object's options.

Returns
DirectionsOptions — Full set of options for the directions object.
getRoute()method 
public function getRoute(i:uint):Route

Return the Route object for the ith route in the response.

Parameters
i:uint — The index of the route to return. This should be in the range 0 to numRoutes - 1, inclusive.

Returns
Route — The Route object for the ith route in the response.

See also

load()method 
public function load(query:String):void

Initiates a directions request. Dispatches either DirectionsEvent.DIRECTIONS_SUCCESS, DirectionsEvent.DIRECTIONS_FAILURE, or DirectionsEvent.DIRECTIONS_ABORTED on completion. Each event serves as a notification that the directions response has come back from the server, and in the case of the success event, the response information can be retrieved from this object. When directions results are received, this object clears old results, replacing them with new ones. Directions results consist of multiple routes, one per consecutive pair of waypoints/addresses specified in the query. In turn, routes consist of multiple steps. If a previous load() request has not completed when a new call to load() is invoked, the previous request is cancelled and a DirectionsEvent.DIRECTIONS_ABORTED event will be dispatched for that request. Thus, you can use a single Directions object to issue directions requests serially, but to generate multiple requests in parallel, you must use multiple Directions objects.

Parameters
query:String — A Maps-style directions query. This can be of the form "from: src to: dst1 to: dst2 ..." or any free-form directions query ("SFO to SJC").

Throws
— A null or empty query will cause an ArgumentError to be thrown.

See also

setOptions()method 
public function setOptions(options:DirectionsOptions):void

Updates the directions options. The options parameter may specify a complete or partial set of directions options.

Parameters
options:DirectionsOptions — New full or partial set of options for directions.