ALKMaps.Layer.RailRouting

Create a vector layer for drawing and managing rail route objects.

Inherits from

Summary
ALKMaps.Layer.RailRoutingCreate a vector layer for drawing and managing rail route objects.
Functions
addRouteAdds a route object and draws it on this layer.
removeRouteRemoves a route from the layer by id.
updateRouteUpdates a route object and draws it on the layer.
setRouteHandleVisibilitySets the visibility of all stop markers and the showHandles option of the route.
setRouteVisibilityMethod for toggling the visibility of the lines and stops of a given route.

Functions

addRoute

addRoute: function(args)

Adds a route object and draws it on this layer.

Parameters

args{Object} with {stops: Object, routeOptions: Object, reportOptions: Object, functionOptions: Object, externalImages: Object}
stops{Array(Object)} format: Todo what is format def?  name: Todo what is name def?  railroad: Todo what is railroad def?
routeOptions{Object} ALK Map service supported options.  See supported route options bellow.  routingPreference: Todo what is the def?  terminalSwitching: Todo what is the def?  amtrakRoutes: Todo what is the def?  intermodalOnlyStations: Todo what is the def?  distUnit: Todo what is the def?
reportOptions{Object} type: Type value can be Detailed, KeyStation, DetailedGeocode, State, or Railroad.  format: Format value can be json or html.  dataVersion: Todo is this needed?  lang: Todo is this needed?
externalImages{Object}
images{Array(String)} Array of image locations that is the same size as the stops array.  (optional)
functionOptions{Object} has routeId {String}, async {Boolean}, style {ALKMaps.Feature.Vector.style} and callback function.  routeId: is used to uniquely identify a route.  async: determines if server call is asynchronous or not.  Default is asynchronous.  style: If this is provided, it will override class level style.  User can supply strokeOpacity, strokeColor, strokeLinecap, strokeWidth, and strokeDashstyle.  Stroke opacity value range is from 0 to 1.  Stroke color takes hex code in string, like “#ee9900”.  Valid value for line cap is “butt”, “round”, or “square”.  Valid value for dash style is “dot”, “dash”, “dashdot”, “longdash”, “longdashdot” or “solid” and most SLD patterns will render correctly.  If stroke width is supplied, default width in the context will be replaced. callback function: called when results are returned from server.  Returned values can be report and updated stops.

removeRoute

removeRoute: function(routeId)

Removes a route from the layer by id.

Parameters

routeId:{String} the same id that is used to add the route to the layer.

updateRoute

updateRoute: function(args)

Updates a route object and draws it on the layer.  If stops, functional options, or report options are not included, it will use the parameters from the original route.

Parameters

args{Object} with {stops: Object, routeOptions: Object, reportOptions: Object, functionOptions: Object, externalImages: Object}
stops{Array(Object)} format: Todo what is format def?  name: Todo what is name def?  railroad: Todo what is railroad def?
routeOptions{Object} ALK Map service supported options.  See supported route options bellow.  routingPreference: Todo what is the def?  terminalSwitching: Todo what is the def?  amtrakRoutes: Todo what is the def?  intermodalOnlyStations: Todo what is the def?  distUnit: Todo what is the def?
reportOptions{Object} type: Type value can be Detailed, KeyStation, DetailedGeocode, State, or Railroad.  format: Format value can be json or html.  dataVersion: Todo is this needed?  lang: Todo is this needed?
externalImages{Object}
images{Array(String)} Array of image locations that is the same size as the stops array.  (optional)
functionOptions{Object} has routeId {String}, async {Boolean}, style {ALKMaps.Feature.Vector.style} and callback function.  routeId: is used to uniquely identify a route.  async: determines if server call is asynchronous or not.  Default is asynchronous.  style: If this is provided, it will override class level style.  User can supply strokeOpacity, strokeColor, strokeLinecap, strokeWidth, and strokeDashstyle.  Stroke opacity value range is from 0 to 1.  Stroke color takes hex code in string, like “#ee9900”.  Valid value for line cap is “butt”, “round”, or “square”.  Valid value for dash style is “dot”, “dash”, “dashdot”, “longdash”, “longdashdot” or “solid” and most SLD patterns will render correctly.  If stroke width is supplied, default width in the context will be replaced. callback function: called when results are returned from server.  Returned values can be report and updated stops.

setRouteHandleVisibility

setRouteHandleVisibility: function(routeId,
showHandles)

Sets the visibility of all stop markers and the showHandles option of the route.

Parameters

routeId{String} The routeID of the route.
showHandles{boolean} Indicates whether the stop markers are displayed.

setRouteVisibility

setRouteVisibility: function (routeId,
showRoute)

Method for toggling the visibility of the lines and stops of a given route.

Parameters

routeId{String} ID of the route
showRoute{Boolean} Indicates whether to show or hide the given route.
addRoute: function(args)
Adds a route object and draws it on this layer.
removeRoute: function(routeId)
Removes a route from the layer by id.
updateRoute: function(args)
Updates a route object and draws it on the layer.
setRouteHandleVisibility: function(routeId,
showHandles)
Sets the visibility of all stop markers and the showHandles option of the route.
setRouteVisibility: function (routeId,
showRoute)
Method for toggling the visibility of the lines and stops of a given route.
Create a vector layer for drawing and managing route objects.
{Object}
Close