Class: EditTrailRoute

alk.source.EditTrailRoute

An instance of this class is a alk.layer.SingleRoutingLayer with an edit trail that can move backward (prev), record (push), and next.

new alk.source.EditTrailRoute(opt_options)

This constructor creates a Source object that combines the functionality of the ALK Routing engine with being able to edit the route and revert to previous routes.

Option Type Description
routeServiceOptions alkx.RouteServiceOptions | undefined

This option contains the options that are given to the underlying alk.service.RouteService to create the route.

Fires:
change:request
Fires the 'change:request' event when done processing the response.
change:route
Fires the 'change:route' event when done processing the response.
change:route
This event is fired when after the request to the alk.service.RouteService is processed.
change:route
Fires the 'change:route' event when done processing the response.
change:updating
This event is fired when the request is being made and when it returns.

Extends

Methods

cloneRouteServiceOptions(options){alkx.RouteServiceOptions} inherited

This method processes clones the RouteServiceOptions including a deep copy of the 'stops' and 'stopTypes' properties.

Option Type Description
apiKey string

This option contains the ALK ApiKey that gives you permission to extract data from ALK Servers.

dataset alk.val.Dataset | number | string

The option contains the Dataset parameter for the Service. This option specifies an area dataset that may be pertinent to the request.

hostURL string

This option contains the the host and port URL for the particular service. This option is not set by the user, but is automatically generated from the particular service being used.

path string

This option is the path part of the URL for the particular service. This option is not set by the user, but is automatically generated from the particular service being used.

region alk.val.Region | number | string

This option tells the service in which region the retrieved data is to pertain. Some ALK Services switch underlying services due to this option. For instance, traffic data for North America and Europe may come from different underlying services.

srs alk.val.SRS | number | string

This option tells the service the particular projection that is used any GIS data given to the service.

stops Array.<Array.<number>>

This option contains the stops that the route is to travel along. It is supplied in Spherical Mercator unless, specified by the 'srs' option. It contains an ordered array of coordinates from origin to destination.

stopTypes Array.<alk.val.StopType> | Object.<number, alk.val.StopType>

This option contains an ordered array or indexed object map of the types of each stop given in the 'stops' option.

vehicleType alk.val.VehicleType | number | string

This option tells the service the type of vehicle that is requesting the route.

routeType alk.val.RouteType | number | string

This option tells the service the type of the route requested. It can be alk.val.RouteType.Practical or alk.val.RouteType.Shortest.

highwayOnly boolean | number | string

This option tells the service to generate a route that will travel mostly along highways.

avoidFavors boolean | number | string

This option tells the service whether or not to use avoids and favors while routing.

overrideClass Array.<(alk.val.OverrideClass|number)> | string

This option tells the service the classes of vehicle travel. Such as alk.val.OverrideClass.NationalNetwork or alk.val.OverrideClass.FiftyThreeFoot.

distanceUnits alk.val.DistanceUnits | number | string

This option tells the service that any distance measurements will be delivered in these units, such as alk.val.DistanceUnits.Kilometers or alk.val.DistanceUnits.Miles.

avoidTolls boolean | number | string

This option tells the service to avoid toll roads and bridges while creating the route.

openBorders boolean | number | string

This option tells the service if the borders are open for travel.

overrideRestrict boolean | number | string

This option tells the service whether to override truck restrictions.

hazMat alk.val.HazMat | number | string

This option tells the service the hazardous material type.

routeOpt alk.val.RouteOptimization | string | undefined

This option tells the service the level of route optimization to use.

hubRouting boolean | number | string

This option tells the service if 'hub routing' is in effect. This means that the starting stop is the hub. The last stop is in effect, not a destination, but a turn around point.

vehicleDimensionUnits alk.val.VehicleDimensionUnits | number | string

This option tells the service in what units, metric or otherwise, the vehicle measurements are presented. Can be either

vehicleHeight number | string

This option contains the height measurement of the vehicle.

vehicleLength number | string

This option contains the length measurement of the vehicle.

vehicleWidth number | string

This option contains the width measurement of the vehicle.

vehicleWeight number | string

This option contains the weight measurement of the vehicle.

axles number | string

This option contains the number of axles on the vehicle.

truckConfig alk.val.TruckConfig | number | string

This option specifies the particular vehicle configuration, such as alk.val.TruckConfig.FullSizeVan, etc.

lcv boolean | number | string

This option tells whether the truck is a multi-trailer or longer combination vehicle.

estimatedTimeOpts string

This option contains the parameter for the estimated time optimizations. This option only affects routing when roads have time based restrictions. Format is described by this BNF notation:

  • fmt ::= DA ('|' Time)?
  • Time :: = DayTime | SpecificDateTime
  • DA ::= 'Depart' | 'Arrive'
  • DayOfWeek ::= 'Monday' | 'Tuesday' | ... | 'Sunday';
  • DayTime ::= DayOfWeek '|' TimeOfDay ('|' TimeZone)?
  • SpecificDateTime ::= YYYY-MM-DDTHH:MM:SS ('|' TimeZone)?

Examples are: -- Arrive|Monday|18:53|Local -- Depart|2016-04-23T09:43:20|Local -- Arrive (meaning system time)

stopsAsViaPoints boolean | number | string

This option tells the service that all stops in between the origin and the destination are to be treated as not a stop, but a via point.

reduceResponsePoints boolean | number | string

This option tells the service whether to reduce the number of response points.

elevationLimit number | string

This option tells the service the distance above sea level to keep the route. Its value is interpreted according to the 'distanceUnits' option.

afSetIds Array.<(string|number)> | string

This option lists the avoid/favor sets to the route.

ferryDiscourage boolean | number | string

This option tells the service to avoid ferries when creating the route.

hosEnabled boolean | number | string

This option enables insertion of Hours Of Service Stops.

hosRuleType alk.val.HosRuleType | number | string

This option indicates the hours of service rule to use. Valid values are alk.val.HosRuleType.USFed607H or alk.val.HosRuleType.USFed708H for US Federal Long Haul rules.

hosRemDriveTimeUntilBreak number | string

This option indicates the available driving hours at the origin before the driver needs to take a rest break.

hosRemDriveTime number | string

This option indicates the available driving hours at the origin until the end of the workday.

hosRemOnDutyTime number | string

This option indicates the available 'On-Duty' hours at the origin until the end of the work day.

hosRemCycleDutyTime number | string

This option indicates the available 'Cycle Time Duty' hours available at the origin until a cycle reset.

sideOfStreetAdherence number | string

This option indicates the strictness in avoiding the opposite side of the street at the destination. TODO: What is the number range? 0-1?

governorSpeedLimit number | string

This option tells the service the maximum average road speed to use in route calculations that overrides all other road speeds when the are above this value. Default is disabled and valid values are between 1 and 100mph. TODO: Is this always in MPH when distanceUnits is Kilometers?

tollDiscourage boolean | number | string

This option tells the service to avoid tolls. Use 'avoidTolls'.

classOverrides Array.<(alk.val.OverrideClass|number)> | string

This option tells the service the travel class overrides. Use 'classOverrides'.

routingType alk.val.RouteType | number | string

This option tells the route type. See alkx.RouteServiceOptions#routeType.

hazMatType alk.val.HazMat | number | string

This option tells the service the HazMat conditions in effect. Use 'hazMat'.

trkUnits alk.val.VehicleDimensionUnits | number | string

This option contains the measurement units for the vehicle. Use 'vehicleDimensionUnits'.

trkHeight number | string

This option contains the height of the vehicle. Use 'vehicleHeight'.

trkLength number | string

This option contains the length of the vehicle. Use 'vehicleLength'.

trkWidth number | string

This option contains the width of the vehicle. Use 'vehicleWidth'.

trkWeight number | string

This option contains the weight of the vehicle. Use 'vehicleHeight'.

trkAxles number | string

This option contains the number of axles on the vehicle. Use 'axles'.

trkLCV boolean | number | string

This option indicates whether the vehicle is a multi-trailer or longer combination. Use 'lcv'.

routeOptimization alk.val.RouteOptimization | number | string

This option tells the service what level of route optimization to perform. Use 'routeOpt'.

Returns:
The cloned object.

getLineFeatures(){Array.<ol.Feature>|undefined} inherited

This method returns an array of the features that are the segments between stops that resulted from the last successful call to alk.source.SingleRoute#setRoute.

Returns:
The line segment features.

This function returns the Route Service options that were in effect when the request was made to the alk.service.RouteService, and its response as a GeoJSON object.

getRouteService(){alk.service.RouteService} inherited

getRouteServiceOptions(){alkx.RouteServiceOptions|undefined}

This method returns the routeServiceOptions that were used to make the last successful call to alk.layer.SingleRoutingLayer#setRoute.

getStopFeatures(){Array.<ol.Feature>|undefined} inherited

This method returns an array of the features that are stops that resulted from the last successful call to alk.source.SingleRoute#setRoute.

Returns:
The stop features.

nextRoute()

This method slides next to the future and places that route there if it exists.

Fires:
changed:route
Fires the 'change:route' event if there is indeed a route in the future queue.

prevRoute()

This method slides back into the history one position, while placing the current route on the future queue.

Fires:
changed:route
Fires the 'change:route' event if there is route in the history queue.

pushRoute(opt_options, success, failure)

This method combines the given options with the routeServiceOptions used to create this layer before making a call to the underlying RouteService. The response is taken from the RouteService call and handed off to alk.layer.SingleRoutingLayer#processResponse before being given to the 'success' callback given here.

Name Type Description
options Object
success function
failure function
Fires:
change:route
Fires the 'change:route' event when done processing the response.

removeRoute() inherited

This method removes the route from the layer, removing all stop and line segment features from the layer's source, which results in their visual removal from the layer.

resetEditTrail()

This method resets the edit trail and removes the route from the layer.

Fires:
changed:route
Fires the 'change:route' event.

setRoute(opt_options, success, failure)

This method combines the given options with the routeServiceOptions used to create this layer before making a call to the underlying RouteService. The response is taken from the RouteService call and handed off to alk.layer.SingleRoutingLayer#processResponse before being given to the 'success' callback given here.

Name Type Description
options Object
success function
failure function
Fires:
change:route
Fires the 'change:route' event when done processing the response.

setRouteService(service) inherited

Name Type Description
service alk.service.RouteService