new alk.service.DriveTimePolygonService(opt_options)
This constructor creates a Service object to access the ALK Drive Time Polygon Service.
It is primarily used as URL generator in the alk.source.DriveTimePolygonSource
.
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. |
center |
Array.<number> | string |
This option contains the center of the search. |
minutes |
number | string |
This option contains the number of driving minutes, with which to size the polygon. |
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 |
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 |
distanceUnits |
alk.val.DistanceUnits | number | string |
This option tells the service that any distance measurements
will be delivered in these units, such as |
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. |
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 |
lcv |
boolean | number | string |
This option tells whether the truck is a multi-trailer or longer combination vehicle. |
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. |
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 |
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'. |
Extends
Methods
-
get(opts_or_callback, responseCallback)
-
This method performs a call to the DriveTimePolygon Service to return a route.
Name Type Description opts_or_callback
alkx.DriveTimePolygonServiceOptions | null | function This parameter contains any options to override or extend the options set in the construction of this object for the call.
Attribute 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.
center
Array.<number> | string This option contains the center of the search.
minutes
number | string This option contains the number of driving minutes, with which to size the polygon.
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
oralk.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
oralk.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
oralk.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.
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
alk.val.VehicleDimensionUnits.English
- 12'6", 12.0 (feet)
alk.val.VehicleDimensionUnits.Metric
- 4.114 (meters)
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.
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.
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'.
responseCallback
function The response handler.
-
getAttribution(opts_or_callback, responseCallback){*|undefined} inherited
-
This method performs a request to this configured service using the supplied options, options set on the constructor, and defaults to get the service's attribution, should it have one. This call results in Object, which may be a parsed JSON response.
Name Type Description opts_or_callback
Object | function This parameter contains any options that override options that are set on this object for this particular request.
responseCallback
function This parameter is the function that handles the response.
-
getServiceOptions(options){Object} inherited
-
This method returns the base options that was used to create this Service object and override them with the given options;
Name Type Description options
Object Returns:
The combined options.
-
getURL(opt_options){string} inherited
-
Returns the URL for the service based on the given options, options set on the constructor, and defaults.
Name Type Description options
Object These options override any relevant options that are set on the object at its construction.
-
processResponse(options, obj){alkx.DriveTimePolygonServiceResponse}
-
This call processes the response before it is given to the callback.
This particular method enhances the response from the ALK/PCM service and modifies it accordingly.
The response returned from DriveTimePolygon Service returns an object containing a type identifier and list of coordinates, which defines a polygon.
Name Type Description options
Object The options that were given with the call combined with the base options used for the
alk.service.DriveTimePolygonService
.obj
Object The GeoJSON response from the
alk.service.DriveTimePolygonService
.Returns:
Containing the driveTimePolygonServiceOptions and if a successful call also contains an object containing the coordinates and a type property.