EMS.Layer.Route

Specialised vector layer which allows simple adding of a route.

Inherits from:OpenLayers.Layer.Vector
Summary
EMS.Layer.RouteSpecialised vector layer which allows simple adding of a route.
Constants
EVENT_TYPES{Array}
Properties
style{Object} Line style use to draw the route.
Constructor
EMS.Layer.RouteCreate a new vector layer
Functions
setRoute
getRoute{EMS.Route} The current route response held.
clearRouteClears the current route off the layer, releasing all resources.
setVisibilityOverride of super class method to ensure that if the layer was previously not visible and is turned on, that route information is refreshed.
Constants
DEFAULT_STYLEDefault vector style used when rendering the route line.

Constants

EVENT_TYPES

{Array}

Properties

style

{Object} Line style use to draw the route.  This will default to EMS.Layer.Route.DEFAULT_STYLE if nothing was passed in as an option.

Constructor

EMS.Layer.Route

Create a new vector layer

Parameters

name{String} A name for the layer
options{Object} options Object with non-default properties to set on the layer

Functions

setRoute

setRoute: function(route)

Parameters

route{Mixed} This maybe an {Object} representing a route request, a {String} which is an existing route handle, an {Array} of waypoints or an EMS.Route object.

getRoute

getRoute: function()

Returns

{EMS.Route} The current route response held.  This may return null if nothing was set.

clearRoute

clearRoute: function()

Clears the current route off the layer, releasing all resources.

setVisibility

setVisibility: function(visibility)

Override of super class method to ensure that if the layer was previously not visible and is turned on, that route information is refreshed.

Parameters

visibility{Boolean} Whether or not to display the layer (if in range)

Constants

DEFAULT_STYLE

Default vector style used when rendering the route line.

setRoute: function(route)
getRoute: function()
{EMS.Route} The current route response held.
Route class which wraps responses from the routing service (see EMS.Service.Route).
clearRoute: function()
Clears the current route off the layer, releasing all resources.
setVisibility: function(visibility)
Override of super class method to ensure that if the layer was previously not visible and is turned on, that route information is refreshed.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Default vector style used when rendering the route line.
Close