Create a vector layer for drawing and managing rail route objects.
ALKMaps. | Create a vector layer for drawing and managing rail route objects. |
Functions | |
addRoute | Adds a route object and draws it on this layer. |
removeRoute | Removes a route from the layer by id. |
updateRoute | Updates a route object and draws it on the layer. |
setRouteHandleVisibility | Sets the visibility of all stop markers and the showHandles option of the route. |
setRouteVisibility | Method for toggling the visibility of the lines and stops of a given route. |
addRoute: function( args )
Adds a route object and draws it on this layer.
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. |
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.
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. |
Adds a route object and draws it on this layer.
addRoute: function( args )
Removes a route from the layer by id.
removeRoute: function( routeId )
Updates a route object and draws it on the layer.
updateRoute: function( args )
Sets the visibility of all stop markers and the showHandles option of the route.
setRouteHandleVisibility: function( routeId, showHandles )
Method for toggling the visibility of the lines and stops of a given route.
setRouteVisibility: function ( routeId, showRoute )