Packagecom.google.maps.services
Classpublic class Route

Objects of this class are created by the Directions object to store information about a single route in a directions result. This class does not have a public constructor. Clients should not directly create objects of this class.



Public Properties
 PropertyDefined by
  distance : Number
[read-only] The total distance of this route in meters.
Route
  distanceHtml : String
[read-only] The total distance of this route in a localized string representation in the units that are predominant in the starting country of this set of directions.
Route
  duration : Number
[read-only] The total time of this route in seconds.
Route
  durationHtml : String
[read-only] The total time of this route in a localized string representation.
Route
  endGeocode : Placemark
[read-only] The geocode result for the ending point of this route.
Route
  endLatLng : LatLng
[read-only] The last point along the polyline for this route.
Route
  numSteps : uint
[read-only] The number of steps in this route.
Route
  startGeocode : Placemark
[read-only] The geocode result for the starting point of this route.
Route
  summaryHtml : String
[read-only] An HTML snippet containing a summary of the distance and time for this route.
Route
Public Methods
 MethodDefined by
  
Constructor.
Route
  
getStep(i:uint):Step
The Step object for the ith step in this route.
Route
Property detail
distanceproperty
distance:Number  [read-only]

The total distance of this route in meters.

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

The total distance of this route 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 route in seconds.

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

The total time of this route in a localized string representation.

Implementation
    public function get durationHtml():String
endGeocodeproperty 
endGeocode:Placemark  [read-only]

The geocode result for the ending point of this route.

Implementation
    public function get endGeocode():Placemark
endLatLngproperty 
endLatLng:LatLng  [read-only]

The last point along the polyline for this route. Note that this point may be different from the lat,lng in Route.endGeocode because endLatLng always returns a point that is snapped to the road network. There is no corresponding startLatLng property because that is identical to Route.getStep(0).latLng.

Implementation
    public function get endLatLng():LatLng
numStepsproperty 
numSteps:uint  [read-only]

The number of steps in this route.

Implementation
    public function get numSteps():uint
startGeocodeproperty 
startGeocode:Placemark  [read-only]

The geocode result for the starting point of this route.

Implementation
    public function get startGeocode():Placemark
summaryHtmlproperty 
summaryHtml:String  [read-only]

An HTML snippet containing a summary of the distance and time for this route.

Implementation
    public function get summaryHtml():String
Constructor detail
Route()constructor
public function Route()

Constructor. Creates an empty route object.

Method detail
getStep()method
public function getStep(i:uint):Step

The Step object for the ith step in this route.

Parameters
i:uint — The index of the Step to get, starting from 0.

Returns
Step