Create a vector layer for drawing and managing route objects.
ALKMaps. | Create a vector layer for drawing and managing route objects. |
Properties | |
dragControl | Property containing the ALKDragFeature control associated with this layer. |
isDraggable | Property indicating whether or not the routes on the layer are draggable. |
Constructor | |
ALKMaps. | Create a vector layer for drawing and managing route objects. |
Functions | |
setMap | The layer has been added to the map. |
addRouteDragHandle | |
getRouteLegPoints | Draw route with stops on this layer. |
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. |
getRouteElements | Gets the ALKMaps vector elements for the route stops and segments drawn on the layer. |
getRouteOptions | Gets all the parameters that are set when the route is added. |
updateNode | Stores feature Id. |
getGeometry | Gets drag handle geometry. |
getPreviousHandle | Gets drag handle after this one. |
getNextHandle | Gets drag handle before this one. |
getNodes | Gets nodes that are connected to the drag handle. |
getDragHandleFromNode | Gets drag handles from the node. |
isStartHandle | Determines a drag handle is a route start point or not. |
isEndHandle | Determines a drag handle is a route end point or not. |
getHandleAction | Determins which drag hadle has been dragged. |
setDraggable | Sets the layer’s ability to have routes be modified by dragging. |
setRouteHandleVisibility | Sets the visibility of all stop markers and the showHandles option of the route. |
setRouteHandle | Sets the style of the route handles by type or index. |
onRouteModified | Callback method. |
Create a vector layer for drawing and managing route objects.
options | {Object} properties to set on this layer. |
{ALKMaps.Layer.Routing} A new vector layer for drawing and managing route objects.
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 of OpenLayer.LatLon objects} |
routeOptions | {Object} ALK Map service supported options. See supported route options bellow. |
reportOptions | {Object} has type and format two keys. Type value can be mileage, directions, detailed or stateMileage. Format value can be json, xml, or html. |
externalImages | {Object} |
images | {Array of Strings} 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. Route Id 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. Only strokeOpacity, and strokeColor are allowed to change. 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} |
stops | {Object} array of OpenLayer.LatLon objects. |
routeOptions | {Object} ALK Map service supported options. See supported route options bellow. |
reportOptions | {Object} has type and format two keys. Type value can be mileage, directions, detailed or stateMileage. Format value can be json, xml, or html. |
functionOptions | {Object} has routeId (String), async (Boolean), style (ALKMaps.Feature.Vector.style) and callback function. Route Id 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. Only strokeOpacity, and strokeColor are allowed to change. callback function: called when results are returned from server. Returned values can be report and updated stops. |
getRouteOptions: function( routeIndex )
Gets all the parameters that are set when the route is added.
routeId: | {String} route id. |
args: | {stops, routeOptions, reportOptions, functionOptions} |
stops: array of OpenLayer.LatLon objects.
routeOptions: ALK Map service supported options. See supported route options bellow.
reportOptions: has type and format two keys. Type value can be mileage, directions, detailed or stateMileage. Format value can be json, xml, or html.
functionOptions: has routeId (String), async (Boolean), style (ALKMaps.Feature.Vector.style) and callback function. Route Id 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. callback function: called when results are returned from server. Returned values can be report and updated stops.
setRouteHandle: function( routeId, stop, handleOptions )
Sets the style of the route handles by type or index.
routeId | {String} The routeID of the route. |
stop | {“O” | “W” | “D” | number} Indicates the type or index of the stop. |
handleOptions | {Object} Object containing style properties to be set. |
The layer has been added to the map.
setMap: function()
addRouteDragHandle: function( handleState, legCoords, isVisible, extImg )
Draw route with stops on this layer.
getRouteLegPoints: function( args )
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 )
Gets the ALKMaps vector elements for the route stops and segments drawn on the layer.
getRouteElements: function( routeId )
Gets all the parameters that are set when the route is added.
getRouteOptions: function( routeIndex )
Stores feature Id.
updateNode: function( oldOne, newOne )
Gets drag handle geometry.
getGeometry: function( handle )
Gets drag handle after this one.
getPreviousHandle: function( hd )
Gets drag handle before this one.
getNextHandle: function( hd )
Gets nodes that are connected to the drag handle.
getNodes: function( hd )
Gets drag handles from the node.
getDragHandleFromNode: function( nd )
Determines a drag handle is a route start point or not.
isStartHandle: function( hd )
Determines a drag handle is a route end point or not.
isEndHandle: function( hd )
Determins which drag hadle has been dragged.
getHandleAction: function( hd )
Sets the layer’s ability to have routes be modified by dragging.
setDraggable: function( isDraggable )
Sets the visibility of all stop markers and the showHandles option of the route.
setRouteHandleVisibility: function( routeId, showHandles )
Sets the style of the route handles by type or index.
setRouteHandle: function( routeId, stop, handleOptions )
Callback method.
onRouteModified: function( obj )