Package | com.google.maps.services |
Class | public final class Directions |
Implements | flash.events.IEventDispatcher, IDirections |
Property | Defined by | ||
---|---|---|---|
bounds : LatLngBounds
[read-only]
The bounding box for the result of this directions query.
| Directions | ||
copyrightsHtml : String [read-only] An HTML string containing the copyright information for this result.
| Directions | ||
distance : Number [read-only] The total distance of this entire directions request in meters.
| Directions | ||
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.
| Directions | ||
duration : Number [read-only] The total time of this entire directions request in seconds.
| Directions | ||
durationHtml : String [read-only]
The total time of this entire directions request in a localized string
representation.
| Directions | ||
numGeocodes : uint [read-only]
The number of geocoded entries available in the result.
| Directions | ||
numRoutes : uint [read-only]
The number of routes available in the result.
| Directions | ||
status : uint [read-only]
The status code of the directions request.
| Directions | ||
summaryHtml : String [read-only]
An HTML snippet containing a summary of the distance and time for this
entire directions request.
| Directions |
Method | Defined by | ||
---|---|---|---|
Directions(options:DirectionsOptions = null)
Constructs a Directions instance for performing directions requests and
retrieving directions results.
| Directions | ||
clear():void
Clears any existing directions results and cancels any pending
load() requests. | Directions | ||
Create the Polyline object associated with the entire directions
response.
| Directions | ||
getGeocode(i:uint):Placemark
Return the geocoded result for the ith waypoint.
| Directions | ||
Retrieves the directions object's options.
| Directions | ||
Return the Route object for the ith route in the response.
| Directions | ||
load(query:String):void
Initiates a directions request.
| Directions | ||
loadFromWaypoints(waypoints:Array):void
Issues a new directions query using an array of waypoints as input instead
of a single query string.
| Directions | ||
setOptions(options:DirectionsOptions):void
Updates the directions options.
| Directions |
Method | Defined by | ||
---|---|---|---|
clearWrapper():void
Remove all event listeners and clear the wrapper.
| Directions |
bounds | property |
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
copyrightsHtml | property |
copyrightsHtml:String
[read-only]An HTML string containing the copyright information for this result.
Implementation public function get copyrightsHtml():String
distance | property |
distance:Number
[read-only]The total distance of this entire directions request in meters.
Implementation public function get distance():Number
distanceHtml | property |
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
duration | property |
duration:Number
[read-only]The total time of this entire directions request in seconds.
Implementation public function get duration():Number
durationHtml | property |
durationHtml:String
[read-only]The total time of this entire directions request in a localized string representation.
Implementation public function get durationHtml():String
numGeocodes | property |
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
numRoutes | property |
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
status | property |
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
summaryHtml | property |
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
Directions | () | constructor |
public function Directions(options:DirectionsOptions = null)
Constructs a Directions instance for performing directions requests and retrieving directions results.
Parametersoptions:DirectionsOptions (default = null ) — Full or partial set of directions options. When a partial
set of options is specified, the direction object's complete set of
options will be a combination of this partial set and the defaults.
|
clear | () | method |
public function clear():void
Clears any existing directions results and cancels any pending
load()
requests.
clearWrapper | () | method |
protected function clearWrapper():void
Remove all event listeners and clear the wrapper.
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).
Parametersoptions:PolylineOptions (default = null ) — Options for the creation of the polyline.
|
IPolyline —
The Polyline object that represents the directions requested.
|
See also
getGeocode | () | method |
public function getGeocode(i:uint):Placemark
Return the geocoded result for the ith waypoint.
Parametersi:uint — The index of the geocoded result to return. This should be in the
range 0 to numGeocodes - 1 , inclusive.
|
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.
ReturnsDirectionsOptions —
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.
Parametersi:uint — The index of the route to return. This should be in the range
0 to numRoutes - 1 , inclusive.
|
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.
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").
|
— A null or empty query will cause an ArgumentError
to be thrown.
|
See also
loadFromWaypoints | () | method |
public function loadFromWaypoints(waypoints:Array):void
Issues a new directions query using an array of waypoints as input instead of a single query string. This array may contain a maximum of 25 waypoint entries. Each entry in the array is a string representation of an input address or lat,lng point.
Parameterswaypoints:Array — An array of waypoints, where each one is either a LatLng
or a string address or point.
|
— A null array or an array of less than two elements
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.
Parametersoptions:DirectionsOptions — New full or partial set of options for directions.
|