EMS.Route

Route class which wraps responses from the routing service (see EMS.Service.Route).

Summary
EMS.RouteRoute class which wraps responses from the routing service (see EMS.Service.Route).
Properties
handle{EMS.Route.Handle} Route handle, an id and expiry.
distance{Float} The distance in metres.
duration{Integer} The duration in seconds.
startPoint{OpenLayers.LonLat}.
endPoint{OpenLayers.LonLat}
bounds{OpenLayers.Bounds}
legs{Array(EMS.Route.Leg)}
routesDeprecated: Use EMS.Route.legs.
Constructor
EMS.Route
EMS.Route.HandleHandle information of a route.
Properties
id{String} Identifier for the route.
expiry{String} Expiry time stamp.
Constructor
EMS.Route.Handle
Functions
equals
clone{EMS.Route.Handle} Returns a clone of the handle.
toString{String} A string representation of the handle, in this case just the id.
EMS.Route.LegA leg (or sub route) of a route.
Properties
distance{Float} The distance in metres.
duration{Integer} The duration in seconds.
startPoint{OpenLayers.LonLat}.
endPoint{OpenLayers.LonLat}
bounds{OpenLayers.Bounds}
segments{Array(EMS.Route.Segments)} Segments which make up the leg of the route.
Constructor
EMS.Route.Leg
Functions
getGeometry{OpenLayers.Geometry.Collection} A collection of geometry objects representing the leg.
EMS.Route.SegmentAn individual segment within a EMS.Route.Leg.
Properties
id{Integer} id of the segment within the EMS.Route.Leg.
bounds{OpenLayers.Bounds} is the bounds of the segment.
distance{Float} The distance in metres.
duration{Integer} The duration in seconds.
startPoint{OpenLayers.LonLat}.
geometry{OpenLayers.Geometry} The actual geometry of the segment.
instruction{EMS.Route.Instruction}
Constructor
EMS.Route.Segment
EMS.Route.InstructionInstruction used in a EMS.Route.Segment.
Properties
road{String} Road type.
suburb{String} Suburb name.
street{String} Street name.
angles{Object} Angle information.
bearing{String} Bearing name such as “SOUTH”.
text{String} Textual instruction.
maneuver{Object} An object with with two properties, the type and feature.
Constructor
EMS.Route.Instruction
Properties
formatConvenience method to replace the underscore characters with HTML tags.
clone{EMS.Route.Instruction} Returns a clone of this instruction.
toString{String} Returns the EMS.Route.Instruction.text for convenience.

Properties

handle

{EMS.Route.Handle} Route handle, an id and expiry.

distance

{Float} The distance in metres.

duration

{Integer} The duration in seconds.

startPoint

legs

{Array(EMS.Route.Leg)}

routes

Deprecated: Use EMS.Route.legs.

Constructor

EMS.Route

Parameters

route{Mixed} is either an EMS.Route or a plain {Object} to wrap.

EMS.Route.Handle

Handle information of a route.

Summary
Properties
id{String} Identifier for the route.
expiry{String} Expiry time stamp.
Constructor
EMS.Route.Handle
Functions
equals
clone{EMS.Route.Handle} Returns a clone of the handle.
toString{String} A string representation of the handle, in this case just the id.

Properties

id

{String} Identifier for the route.

expiry

{String} Expiry time stamp.

Constructor

EMS.Route.Handle

Parameters

handle{EMS.Route.Handle|Object} is the object to wrap.

Functions

equals

equals: function(handle)

Parameters

handle{Mixed} is either an EMS.Route.Handle or a plain {Object} to test for equality.

Returns

{Boolean} Returns true if the input handle equals this handle.

clone

clone: function()

Returns

{EMS.Route.Handle} Returns a clone of the handle.

toString

toString: function()

Returns

{String} A string representation of the handle, in this case just the id.

EMS.Route.Leg

A leg (or sub route) of a route.

Summary
Properties
distance{Float} The distance in metres.
duration{Integer} The duration in seconds.
startPoint{OpenLayers.LonLat}.
endPoint{OpenLayers.LonLat}
bounds{OpenLayers.Bounds}
segments{Array(EMS.Route.Segments)} Segments which make up the leg of the route.
Constructor
EMS.Route.Leg
Functions
getGeometry{OpenLayers.Geometry.Collection} A collection of geometry objects representing the leg.

Properties

distance

{Float} The distance in metres.

duration

{Integer} The duration in seconds.

startPoint

segments

{Array(EMS.Route.Segments)} Segments which make up the leg of the route.

Constructor

EMS.Route.Leg

Parameters

leg{Mixed} is either an EMS.Route.Leg or {Object} to wrap, may be null.

Functions

getGeometry

getGeometry: function()

Returns

{OpenLayers.Geometry.Collection} A collection of geometry objects representing the leg.  This will never return null but may return an empty collection.

EMS.Route.Segment

An individual segment within a EMS.Route.Leg.  This contains the geometry, bounds and instruction information.

Summary
Properties
id{Integer} id of the segment within the EMS.Route.Leg.
bounds{OpenLayers.Bounds} is the bounds of the segment.
distance{Float} The distance in metres.
duration{Integer} The duration in seconds.
startPoint{OpenLayers.LonLat}.
geometry{OpenLayers.Geometry} The actual geometry of the segment.
instruction{EMS.Route.Instruction}
Constructor
EMS.Route.Segment

Properties

id

{Integer} id of the segment within the EMS.Route.Leg.

bounds

{OpenLayers.Bounds} is the bounds of the segment.

distance

{Float} The distance in metres.

duration

{Integer} The duration in seconds.

startPoint

geometry

{OpenLayers.Geometry} The actual geometry of the segment.  This is used when drawn on a map and can be a OpenLayers.Geometry.LineString or OpenLayers.Geometry.MultiLineString.

Constructor

EMS.Route.Segment

Parameters

segment{Mixed} is either an EMS.Route.Segment or a plain {Object} to wrap.  This may be null.

EMS.Route.Instruction

Instruction used in a EMS.Route.Segment.

Summary
Properties
road{String} Road type.
suburb{String} Suburb name.
street{String} Street name.
angles{Object} Angle information.
bearing{String} Bearing name such as “SOUTH”.
text{String} Textual instruction.
maneuver{Object} An object with with two properties, the type and feature.
Constructor
EMS.Route.Instruction
Properties
formatConvenience method to replace the underscore characters with HTML tags.
clone{EMS.Route.Instruction} Returns a clone of this instruction.
toString{String} Returns the EMS.Route.Instruction.text for convenience.

Properties

road

{String} Road type.

This may be one of the following

  • MOTORWAY
  • MAIN_ROAD
  • MAJOR_ROAD
  • SECONDARY_ROAD
  • LOCAL_CONNECTING_ROAD
  • LOCAL_ROAD_OF_HIGH_IMPORTANCE
  • LOCAL_ROAD
  • LOCAL_ROAD_OF_LOW_IMPORTANCE
  • OTHER_ROAD
  • UNDEFINED

suburb

{String} Suburb name.

street

{String} Street name.

angles

{Object} Angle information.  This may contain {Float} properties of origin, destination and turn.

bearing

{String} Bearing name such as “SOUTH”.

text

{String} Textual instruction.  This uses the underscore character to denote emphasized text.

Examples

Turn left onto Cardigan St, Carlton At the roundabout take the 2nd exit onto Cardigan St, Carlton

maneuver

{Object} An object with with two properties, the type and feature.

The type may be something such as

  • Start
  • Stop
  • Straight
  • Right
  • Left
  • Veer Right
  • Veer Left
  • Sharp Right
  • Sharp left
  • Right U-Turn
  • Left U-Turn
  • Right Fork
  • Left Fork
  • Ferry Embark
  • Ferry Disembark
  • Roundabout

The feature, which may not be set, is extra information about the maneuver

  • Exit Ramp
  • Entrance Ramp
  • Ramp
  • Exit Number for Rounadabout

Constructor

EMS.Route.Instruction

Parameters

instruction{Mixed} is either an EMS.Route.Instruction or a plain {Object} to wrap.

Properties

format

Convenience method to replace the underscore characters with HTML tags.

Parameters

tag{String} is the tag such as “strong” that will be wrapped around the emphasized text.  If not set, this will default to “em”.

Returns

{String} Returns the text with the emphasized markers replaced with HTML tags.

clone

Returns

{EMS.Route.Instruction} Returns a clone of this instruction.

toString

Returns

{String} Returns the EMS.Route.Instruction.text for convenience.

Gets the directions or route from one location to another.
Handle information of a route.
This class represents a longitude and latitude pair
Instances of this class represent bounding boxes.
A leg (or sub route) of a route.
{Array(EMS.Route.Leg)}
equals: function(handle)
clone: function()
{EMS.Route.Handle} Returns a clone of the handle.
toString: function()
{String} A string representation of the handle, in this case just the id.
An individual segment within a EMS.Route.Leg.
getGeometry: function()
{OpenLayers.Geometry.Collection} A collection of geometry objects representing the leg.
A Collection is exactly what it sounds like: A collection of different Geometries.
A Geometry is a description of a geographic object.
Instruction used in a EMS.Route.Segment.
{String} Textual instruction.
A LineString is a Curve which, once two points have been added to it, can never be less than two points long.
A MultiLineString is a geometry with multiple OpenLayers.Geometry.LineString components.
Close