ALKMaps.Services

A utility class can be used to consume ALK mapping, geocoding, and routing services.

Summary
ALKMaps.ServicesA utility class can be used to consume ALK mapping, geocoding, and routing services.
Functions
getCustomPlacesGet custom places for a given account.
updateCustomPlaceSetUpdate custom place set’s name, and tag for a given set id and tag.
deleteCustomPlaceSetDelete custom place set for a given id.
deleteCustomPlaceDelete custom place.
getCustomCategoriesGet custom categories.
addCustomCategoryAdd custom category.
updateCustomCategoryUpdate custom categories.
getReportsTakes coords objects and report options, return total time and total distance synchronously.
postReportsTakes coords objects and report options, return total time and total distance synchronously.
getRoutePathTakes coords objects and route options, return lat/lons for the route path.
postRoutePathTakes coords objects and route options, return lat/lons for the route path.
postRoutePathRawSame as services.postRoutePath function.
getDerivedRoutePathTake pings and route options, return derived route points.
postDerivedRoutePathRetrieve a list of reduce trip coordinates in GeoJson format based on a series of longitudes/latitude pings and off route mileages window.
postDerivedRouteReportsThe postDerivedRouteReports operation will return either mileage or detail report for the reduced trip based upon a series of latitude/longitudes pings.
getRoadSurfaceRouteAllows a user to request road surface conditions for each point of a route path.
addAvoidFavorSetAdd a new avoid/favor set.
getAvoidFavorSetsRetrieves all AvoidFavorSets, one specific set if the setId is specified.
updateAvoidFavorSetUpdate name and tag based on set Id.
deleteAvoidFavorSetDeletes the AvoidFavor set.
addAvoidFavorAdd a new set with closure.
deleteAvoidFavorDeletes a specific AvoidFavors within a set.
poiRadiusSearchGets points of interest within a specified radius of a given point.
weatherAlertsGet weather alerts.
weatherAlertsGeoJsonGets weather alerts in GeoJson.
countyPolygonsGets county polygons.
zipPolygonsGets zip polygons.
statePolygonsGets state polygons.
getDriveTimePolygonGet a polygon of drivable locations from the center point within a specified time constraint.
getTrafficIncidentsBoxRetrieves traffic incidents within the given bounding box
getTrafficCamerasBoxRetrieves traffic cameras within the given bounding box
getTrafficCameraMetadataRetrieves traffic camera metadata for the given camera id.
getAttributionRetrieves the necessary attribution for a given layer based on the layer’s type and its settings.
postRailRoutePathTakes stops objects and route options, return lat/lons in geo json.
getRailStationsTakes SPLC code and returns first matched station if there is one.
getSitesBoxGets ALK sites
getAvoidFavorSetsGets avoid/favor sets for API key.
getAvoidFavorGroupGets avoid/favor for a given set.
getAvoidFavorBoxGets avoid/favor for a given set within a given bounding box.
getTruckRestrictionsGets truck restrictions for a given bounding box.
ServicesThe ALKMaps services class

Functions

getCustomPlaces

services.getCustomPlaces = function (inputs)

Get custom places for a given account.

Parameters

inputs{Object} Accept id, tag and bounds properties.

Valid inputs include

id{Number} Custom places set id.
includePlaces{Boolean} Indicates whether to also include custom places within each set.  If false, bounds, placeName, catId, catName will be ignored.
tag{String} Custom places set tag.  (optional)
bounds{ALKMaps.Bounds} Tile bounds for custom places within this box.
placeName{String} refine the results by optional custom place name.  (optional)
catId{Number} refine the results by optional custom category id.  (optional)
catName{String} refine the results by optional custom category name.  (optional)
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)
ALKMaps.Services.getCustomPlaces({
    id: 82,
    includePlaces: true,
    catId: 61,
    bounds: {left: -80,top: 40,bottom: 50,right: -70},
    success: function(response){}
});

Returns

An example of returned object

[{"SetID":9,"SetName":"Walmart","SetTag":"AccountId:3","CustomPlaces":[{"Address":{"StreetAddress":"1400 W WABANSIA AVE","City":"CHICAGO","State":"","Zip":"60622","County":"US","Country":null,"SPLC":null,"CountryPostalFilter":0,"AbbreviationFormat":0},"Coords":{"Lat":"41.913408","Lon":"-87.663022"},"Region":4,"Label":null,"PlaceName":"TACTICA INTERNATIONAL LLC 3","PlaceId":185186,"PlaceType":null,"Phone":null,"Category":null}]}]

updateCustomPlaceSet

services.updateCustomPlaceSet = function (inputs)

Update custom place set’s name, and tag for a given set id and tag.

Parameters

inputs{Object}

Valid inputs include

id{Number} the existing custom place set id.
name{String} the new name you want to assign to the set.
tag{String} the new tag you want to assign the set.
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)

Returns

{Number} The number of rows affected.

deleteCustomPlaceSet

services.deleteCustomPlaceSet = function (inputs)

Delete custom place set for a given id.

Parameters

inputs{Object}

Valid inputs include

id{Number} the existing custom place set id.
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)

Returns

{Number} The number of rows affected.

deleteCustomPlace

services.deleteCustomPlace = function (inputs)

Delete custom place.  User needs to supply the set ID and the place ID and it will delete only place IDs in that set, otherwise error.

Parameters

inputs{Object}

Valid inputs include

setId{Number} ID of set that the custom place is in.
placeId{Number} ID of the custom place.
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)

Returns

{Number} The number of rows affected.

getCustomCategories

services.getCustomCategories = function (inputs)

Get custom categories.  If no parameters are provided, all custom categories are returned for an account.

Parameters

inputs{Object}

Valid inputs include

id{Number} Category ID number is used to retrieve a specific category.  (optional)
tag{String} Category tag is used to refine results.  (optional)
name{String} Category name is used to refine results.  (optional)
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)

Returns

[{ “Id”: number, “Name”: string, “Icon”: string, “IconURL”: string, “Tag”: string }]

addCustomCategory

services.addCustomCategory = function (inputs)

Add custom category.

Parameters

inputs{Object}

Valid inputs include

categoryToAdd{Object}

Valid category object includes

name{String} name of category.
icon{String} name of category icon.
iconURL{String} image URL of category icon.
tag{String} category tag.
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)

Returns

{Number}category id.

updateCustomCategory

services.updateCustomCategory = function (inputs)

Update custom categories.

Parameters

inputs{Object}

Valid inputs include

categoryToUpdate{Object} Array of custom categories.

Valid category object includes

id{Number} Category ID.
name{String} Category name.
icon{String} Optional new icon name, but if no value is specified the field will be set to null.  (optional)
inconURL{String} Optional new icon image URL, but if no value is specified the field will be set to null.  (optional)
tag{String} Optional new category tag, but if no value is specified the field will be set to null.  (optional)
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)

Returns

{Number}The number of rows affected.

getReports

services.getReports = function (params)

Takes coords objects and report options, return total time and total distance synchronously.  IE Trident and Edge have request length limitations on HTTP GET method.  If too many (about more than 80) stops are supplied, this method may reduce precision of each stop before sending them over.

Parameters

inputs{Object}

Valid inputs include

coords{Array of decimal pairs} Coordinates of the start, end, and any waypoints for the given route.
stopCostsStop costs for each stop on the route.  Format: StopCosts delimited by ‘|’ [StopCosts1]|[StopCosts2]|...|[StopCostsN] StopCosts Format: [CostOfStop],[HoursPerStop],[Loaded],[OnDuty],[UseOrigin] Example: 0.0,0.0,true,true,true|1.0,0.2,false,true,true|...|5.0,5.0,true,false,true
options{Object} optional function specification settings.
reportOptions{Object} optional reporting specification settings.

Valid options include

vehicleType{Number} Restricts the route to roads that are accessible by the selected vehicle.  Default: 0 (0 - Truck, 1 - Light Truck, 2 - Automobile)
routingType{Number} Generates the route to match the type.  Default: 0 (0 - Practical, 1 - Shortest)
highwayOnly{Boolean} Restricts the route to only highway roads.  Default: false
custRdSpeeds{Boolean} Can be true or false and indicates whether to use custom road speeds.
useAvoidFavors{Boolean} Can be true or false and indicates whether or not to use avoids and favors while routing.
classOverrides{Number} 0 - Indicates that no class overrides are present, 1 - Indicates a 53’ class override, 2 - Indicates a National Network class override.  Default: 0
distanceUnits{Number} Distance units as miles or kilometers.  Default: 0 (0 - Miles, 1 - Kilometers)
fuelUnits{Number} Fuel units as gallons and liters.  Default: 0 (0 - Gallons, 1 - Liters)
tollDiscourage{Boolean} Generates the route by trying to avoid toll roads.  Default: false
inclFerryDist{Boolean} Indicates whether or not to include ferry distances in mileage calculations; can be true or false.
bordersOpen{Boolean} Indicates whether borders are open for travel.  Default: true
overrideRestrict{Boolean} Indicates whether or not to override truck restrictions.  Default: false
hazMatType{Number} Restricts the route to roads that allow transportation of the selected hazardous material.  Default: 0 (0 - None, 1 - General, 2 - Caustic, 3 - Explosives, 4 - Flammable, 5 - Inhalants, 6 - Radioactive, 7 - HarmfulToWater)
tunnelCategory{Number} Indicates the tunnel categories which are applicable for EU region only.  Values can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
routeOptimization{Number} 0 - None, 1 - Optimize All Stops, 2 - Optimize Intermediate Stops.  Default: 0
hubRouting{Boolean} Indicates whether or not to enable hub routing; can be true or false.
trkUnits{Number} Vehicle dimension units; can be English or Metric.  Default: 0 (0 - Indicates that vehicle dimension units should be English, 1 - Indicates that vehicle dimension units should be metric)
trkHeight{String} or {Number} The height of the vehicle in feet and inches or meters depending on units.
trkLength{String} or {Number} The length of the vehicle in feet and inches or meters depending on units.
trkWidth{String} or {Number} The width of the vehicle in feet and inches or meters depending on units.
trkWeight{Number} The weight of the vehicle in pounds or kilograms depending on units.
trkAxles{Number} The number of axles on the vehicle; acceptable values are 2 through 14.  Default: 5
truckConfig{Number} The vehicle style.  Default: 0 (0 - no vehicle style is chosen, 1 - 28’ double trailer, 2 - 40’ straight trailer, 3 - 48’ semitrailer, 4 - 53’ semitrailer)
trkLCV{Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle.
inclTollData{Boolean} Indicates whether or not reports should calculate toll costs.  Default: true
fuelEconLoad{Number} The fuel efficiency (distance units per fuel units) when loaded.
fuelEconEmpty{Number} The fuel efficiency (distance units per fuel units) when empty.
costPerFuelUnit{Number} The cost per fuel unit of fuel.
costGHG{Number} The cost of greenhouse gas in lbs. per fuel unit.
costMaintLoad{Number} The maintenance cost per distance unit when loaded.
costMaintEmpty{Number} The maintenance cost per distance unit when empty.
costTimeLoad{Number} The time cost per mile/km when loaded.
costTimeEmpty{Number} The time cost per mile/km when empty.
tollCurrency{Number} The toll currency.  Default: 0 (0 - United States dollars, 1 - Canadian dollars)
exchangeRate{Number} The change rate to convert US dollars to Canadian dollars.
tollPlan{String} The toll discount plan which is a comma-separated list of toll discount programs.  Use All for everything otherwise valid values are (407ETR Transponder,A25 Transponder,BreezeBy,C-Pass,Cruise Card,E-Pass,E-Pass Canada,EXpress Toll,EZ Tag,EZPass,EZPass-NJ,EZPass-WV,FAST LANE,FasTrak,GeauxPass,Good To Go,GO-PASS,I-Pass,I-Zoom,K-TAG,Laredo Trade Tag,LeeWay,MACPASS,NC Quick Pass,NEXPress,Palmetto Pass,Peach Pass,PikePass,Quickpass,Smart Tag,StraitPASS,SunPass,TollTag,TxTag,Wabash Pass)
citeInt{Number} The cite interval to be used when generating a geotunnel report.  The minimum value is 0.1.
region{String} The data region in which the route stops are located.  Default: NA (NA - North America, EU - Europe, OC, SA - South America)
estimatedTimeOpts{String} Estimated time options, format Depart(Arrive)|[DayOfWeek][SpecificDateTime]|[TimeOfDay], ex: Depart|Monday|18:30 to depart given day of week and time of day; or Arrive|2014-03-04T08:15:30-05:00 to arrive at specific date/time, or Arrive or Depart to arrive or depart with system time.
breakInterval{Number} The elapsed time of the trip before a break will be taken.  The format is in decimal hours, ex: 3.5 for 3 hours 30 minutes.
breakLength{Number} The amount of time a break will last.  The format is in decimal hours, ex: 0.5 for 30 minutes.
borderWait{Number} The additional amount of time at the border to the overall trip.  The format is in decimal hours.
remHrsOfSvc{Number} The remaining hours of service at the start of the trip before the driver needs to take a break.  The format is in decimal hours.
useTraffic{Boolean} Indicates whether or not use traffic when calculating trip transit times.
elevLimit{Number} Indicates the elevation limit when generating a route.  Default value is null.  Elevation unit can be either meters or feet is determined by the {distUnits} parameter.  Miles = feet, Kilometers = meters.  Available for dataversions Current, PCM_NA, PCM29.  Limit will be ignored if: Routing is deemed impractical with the limit, or a stop is located at an elevation higher than the limit.
ferryDiscourage{Boolean} Indicates whether or not to discourage the use of ferries when creating the route.  Default: false
afSetIDs{Array<Number>} The avoid/favor set ids to apply to the route.
governorSpeedLimit{Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value.  Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}
sideOfStreetAdherence{Number} Represents the levels of adherence that apply a cost to a route if its destination is on the opposite side of the street; can be Off (0), Minimal (1), Moderate (2), Average (3), Strict (4), Adhere (5), StronglyAdhere (6)
useSites{Boolean} Indicates whether to use sites as part of the route calculation.  If useSites is enabled and any of the stops on the route fall within an ALK site or applicable customer site, then the route itself will be affected by those sites.  Entry / exit gates to / from that stop will be added as part of the route.  Eventually the preferred first mile / last mile route path and reports will be affected.

Valid report options include

type{String} Comma-separated list of requested report types.  (Mileage, Directions, Detail, State, CalcMiles, LeastCost, Geotunnel, TollDetail(EU region only))
format{String} The format of the report returned with the route.  Default: json (json, html)
dataVersion{String} The data version against which this request should be performed.  Valid values are ‘current’, ‘PCM18’ through ‘PCM30’ or for regional datasets use PCM_XX( where XX is the two letter region abbreviation).
lang{String} The language.  (ENUS - English United States, ENGB - English Great Britain, DE - German, FR - French, ES - Spanish, IT - Italian)
routeId{String} Route ID.
condenseDirs{Boolean} Indicate whether or not to get the condensed version of the directions report.  Default: false
trlType{String} (for EU TollDetail report only) Type of the trailer.  Available values are None, Caravan, Trailer.  Default is None.
trlMaxWt{Number} (for EU TollDetail report only) Max weight of the trailer in pounds or kilograms depending on units.
trlMaxHt{Number} or {String} (for EU TollDetail report only) Max height of the trailer in feet and inches, or meters depending on units.
trlMaxAxles{Number} (for EU TollDetail report only) Max number of axles on the trailer.  Acceptable values are 1 - 8.  Default is 1.
trlCount{Number} (for EU TollDetail report only) Number of trailers and semi-trailers.  Default is 0.
isHybrid{Boolean} (for EU TollDetail report only) Indicates whether vehicle has a hybrid engine.  Default is false.
minPoll{Boolean} (for EU TollDetail report only) Indicates whether the vehicle is a minimum vehicle pollution.  Default is false.
emiType{String} (for EU TollDetail report only) The emission type of the engine.  Available values are EuroI, EuroII, EuroIII, EuroIV, EuroV, EuroVI.
ALKMaps.Services.getReports({
    coords: [[-75.173297,39.942892],[-74.438942,39.362469]],
    stopCosts: "0.0,0.0,true,true,true|1.0,0.2,false,true,true|...|5.0,5.0,true,false,true",
    options: {
        vehicleType: 2,
        routingType: 0,
        routeOptimization: 1,
        highwayOnly: false,
        distanceUnits: 0,
        tollCurrency: 0,
        inclTollData:true,
        region: "NA"
    },
    reportOptions: {
        type: "Directions,Mileage",
        format: "json",
        dataVersion: "current",
        lang: "ENUS",
        routeId: "route 1",
        condenseDirs: true,
        trlType: "Trailer",
        trlMaxWt: 83000,
        trlMaxHt: "13\'4\"",
        trlMaxAxles: 2,
        trlCount: 1,
        minPoll: false,
        emiType: "EuroV"
    },
    success: function(resp){console.log(resp)}
});

postReports

services.postReports = function (inputs)

Takes coords objects and report options, return total time and total distance synchronously.

Parameters

inputs{Object}

Valid inputs include

request{Object} The object that makes up params for the route report request.
dataVersion{String} or {Number} The data version against which this request should be performed.  Valid values are ‘current’, ‘PCM18’ through ‘PCM30’ or for regional datasets use PCM_XX( where XX is the two letter region abbreviation).
success{Function} Callback function called after success with the return object as a parameter.  (optional)
failure{Function} Callback function called after failure with the return object as a parameter.  (optional)

Example request body

{
    "request": {
        "ReportRoutes": [{
            // ReportingOptions - {Object} Represents options specific to creation of reports.
            "ReportingOptions": {
                // reportFmt - {String} Represents the report format. Used in client side only.
                "reportFmt": "JSON",
                // UseTollData - {Boolean} Indicate whether or not toll data should be used.
                "UseTollData": true,
                // FuelUnits - {String} Indicate the fuel units to gallons(0) or liters(1).
                "FuelUnits": 0,
                // RouteCosts - {Object} Represents the route cost information associated with Route.
                "RouteCosts": {
                    // FuelEconomyLoaded - {Number} The fuel efficiency (distance units per fuel volume units) when loaded.
                    "FuelEconomyLoaded": 8.5,
                    // FuelEconomyEmpty - {Number} The fuel efficiency (distance units per volume units) when empty.
                    "FuelEconomyEmpty": 11.9,
                    // PricePerFuelUnit - {Number} The price per gallon of fuel.
                    "PricePerFuelUnit": 13,
                    // TruckStyle - {Number or String} The vehicle style. Default: 0 (0 - no vehicle style is chosen,
                    //    1 - 28' double trailer, 2 - 40' straight trailer, 3 - 48' semitrailer, 4 - 53' semitrailer).
                    "TruckStyle": 0,
                    // GreenHouseGas - {Number} The greenhouse gas cost in lbs. per fuel unit.
                    "GreenHouseGas": 5.2,
                    // OtherCostPerDistUnitLoaded - {Number} The maintenance cost per distance unit when loaded.
                    "OtherCostPerDistUnitLoaded": 12.2,
                    // OtherCostPerDistanceUnitEmpty - {Number} The maintenance cost per mile when empty.
                    "OtherCostPerDistanceUnitEmpty": 8.9,
                    // CostTimeLoaded - {Number} The estimated labor or other cost per hour when loaded.
                    "CostTimeLoaded": 15.5,
                    // CostTimeEmpty - {Number} The estimated labor or other cost per hour when empty.
                    "CostTimeEmpty": 12.6
                },
                // TimeCosts - {Object} DEPRECATED. Use HosOptions instead.
                "TimeCosts": {
                    "DepartTime": null,
                    "BreakInterval": 0,
                    "BreakLength": 0,
                    "BorderWait": 0,
                    "RemainingHoursOfService": 0
                },
                // TollCurrency - {String} The toll currency, currently US or CDN.
                "TollCurrency": 0,
                // ExchangeRate - {String} The change rate to convert US dollars to Canadian dollars.
                "ExchangeRate": 1.01,
                // TollDiscount - {String} A string containing the applicable toll discount program.
                //    This field is only valid if the user has quarterly toll data privileges and the UseTollData
                //    is set to true. Available programs are: 407ETR Transponder, A25 Transponder, BreezeBy,C-Pass,
                //    Cruise Card, E-Pass, E-Pass Canada, EXpress Toll, EZ Tag, EZPass, EZPass-NJ, EZPass-WV, FAST LANE,
                //    FasTrak, GeauxPass, GO-PASS, Good to Go, I-PASS, I-Zoom, K-TAG, Laredo Trade Tag, Leeway, MACPASS,
                //    NC Quick Pass, NEXPRESS TOLL, Palmetto Pass, Peach Pass, PikePass, Quickpass, Smart Tag, StraitPASS,
                //    SunPass, TollTag, TxTag, and WabashPass or All.
                "TollDiscount": "ezpass",
                // IncludeFerryDistance - {Boolean} Indicates whether or not miles traveled on ferries are included in mileage calculation.
                //    The default is true.
                "IncludeFerryDistance": true,
                // UseCustomRoadSpeeds - {Boolean} Indicates whether or not to use custom road speeds.
                "UseCustomRoadSpeeds": false,
                // Language- {String} Language in which the information is to be displayed.
                //    The default is ENUS for English United States.
                "Language": 0,
                // EstimatedTimeOptions - {Object} Used to only affect eta/etd in reports,
                //    but now can affect the route on road restrictions that are time based.
                "EstimatedTimeOptions": null,
                // UseTraffic - {Boolean} Indicates whether or not to use traffic data when calculating transit times,
                //    or when using fastest routing.
                "UseTraffic": false,
                // TruckStyle - {Number or String} The vehicle style. Default: 0 (0 - no vehicle style is chosen,
                //    1 - 28' double trailer, 2 - 40' straight trailer, 3 - 48' semitrailer, 4 - 53' semitrailer).
                "TruckStyle": 0
            },
            // ReportTypes - {Array<Object>} Indicate different report types that the user would like to generate.
            //    Valid are: MileageReportType, DetailReportType, CalculateMilesReportType, DirectionsReportType
            //    FuelReportType, GeoTunnelReportType, LeastCostReportType, RoadReportType and StateReportType.
            //    The __type shall keep the same format as below.
            "ReportTypes": [{
                "__type": "DirectionsReportType:http:\/\/pcmiler.alk.com\/APIs\/v1.0",
                "CondenseDirections": false
            }],
            "RouteId": null,
            // // Stops - {Object} The array of coordinates that make up the stops of the route.
            "Stops": [{
                // Coords - {ALKMaps.LonLat} Longitude and latitude coordinates of the stop.
                "Coords": {
                    "Lat": "42.123450",
                    "Lon": "-76.123450"
                },
                // Region - {String/Number} The data region in which pings are located.
                //    Choices are NA; AF, AS, EU, NA, OC ,SA and ME for world-wide. AF indicates Africa,
                //    AS indicates Asia, EU indicates Europe, NA indicates the North America,
                //    OC indicates Oceania, SA indicates South America. The default is NA.
                "Region": 4
                // Label - {String} Represents a label to be displayed on maps and in reports in association with a stop.
            }, {
                "Coords": {
                    "Lat": "42.123120",
                    "Lon": "-76.123120"
                },
                "Region": 4

            }, {
                "Coords": {
                    "Lat": "42.124560",
                    "Lon": "-76.124560"
                },
                "Region": 4

            }],
            "Options": {
                // VehicleType - {Number} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2).
                "VehicleType": 0,
                // RoutingType - {Number} The desired routing algorithm which can be Practical (0) or Shortest (1).
                "RoutingType": 1,
                // HighwayOnly - {Boolean} To indicate whether to use highway only routing or not. The default is false.
                "HighwayOnly": true,
                // FuelRoute - {Boolean} To indicate whether or not a fuel optimized route is desired.
                "FuelRoute": false,
                // UseAvoidsAndFavors - {Boolean} Can be true or false and indicates whether or not to use avoids and favors while routing.
                "UseAvoidsAndFavors": false,
                // ClassOverrides - {Number} A comma-separated list of class overrides which can be None (0x0),
                //    NationalNetwork (0x1) and/or FiftyThreeFoot (0x2). Default is None.
                "ClassOverrides": 1,
                // DistanceUnits - {Number} Distance units as Miles (0) or Kilometers (1).
                "DistanceUnits": 0,
                // TollDiscourage - {Boolean} Indicates whether or not to avoid tolls while routing;
                // Can be true or false. Default is false.
                "TollDiscourage": true,
                // BordersOpen - {Boolean} Indicates whether borders are open for travel; can be true or false.
                "BordersOpen": true,
                // OverrideRestrict - {Boolean} Indicates whether or not to override truck restrictions;
                //    Can be true or false.  Default is false.
                "OverrideRestrict": false,
                // HazMatType - {Number} Indicates the hazardous material type; can be None (0), General (1),
                //    Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), HarmfulToWater (7).
                "HazMatType": 3,
                // TunnelCategory - {Number} Indicates tunnel categories, applicable for EU region only.
                // can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
                "TunnelCategory": 0,
                // routeOptimization - {Number} Indicates the method by which to optimize route stops;
                //    Can be None (0), ThruAll (1) or DestinationFixed (2).
                "RouteOptimization": 2,
                "TruckCfg": {
                    // Weight - {String} or {Number} The weight of the truck in pounds or kilograms depending on units.
                    //    Acceptable values can be up to 132,000 pounds or 59,874 kilos.
                    //    The default value is 80,000 pounds for all regions.
                    "Weight": "9000",
                    // Axles - {Number} The number of axles on the truck;
                    //    acceptable values are 2 through 14 and the default value is 5.
                    "Axles": 6,
                    // Units - {Number} Vehicle dimension units; can be English (0) or Metric (1).
                    "Units": 0,
                    // LCV - {Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle;
                    //    Can be true or false.
                    "LCV": false,
                    // Width - {String} or {Number} The width of the truck in feet and inches or meters depending on units.
                    //    This value can be 96" and below, 102" and above or 98".
                    //    The default value is 96" for all regions. Example 13'6" or 4.1148.
                    "Width": "8'0"
                },
                // this is only used for EU TollDetail report.
                "TrailerCfg": {
                    // TypeOfTrailer - {Number} Type of the trailer.
                    //    Acceptable values are 1 - None, 2 - Caravan, 3 - Trailer.
                    //    Default is 1.
                    "TypeOfTrailer": 3,
                    // Count - {Number} Number of trailers and semi-trailers. Default is 0.
                    "Count": 1,
                    // MaxHeight - {Number} or {String} Max height of the trailer in feet and inches, or meters depending on units.
                    "MaxHeight": "13'4\"",
                    // MaxWeight - {Number} Max weight of the trailer in pounds or kilograms depending on units.
                    "MaxWeight": false,
                    // MaxAxles - {Number} Max number of axles on the trailer. Acceptable values are 1 - 8.
                    //    Default is 1.
                    "MaxAxles": false,
                    "Engine": {
                        // Hybrid - {Boolean} Indicates whether vehicle has a hybrid engine.
                        //     Default is false.
                        "Hybrid": false,
                        // EmissionType - {Number} The emission type of the engine. Available values are 3 - EuroI, 4 - EuroII, 5 - EuroIII, 6 - EuroIV, 7 - EuroV, 8 - EuroVI.
                        "EmissionType": 7,
                        // MinPollutionVeh - {Boolean} Indicates whether the vehicle is a minimum vehicle pollution.
                        //     Default is false.
                        "MinPollutionVeh": false
                    }
                },
                // HubRouting - {Boolean} Indicates whether or not to enable hub routing; can be true or false.
                "HubRouting": false,
                // AFSetIDs - {Array<Number>} The avoid/favor set ids to apply to the route.
                "AFSetIDs": null,
                // ElevLimit - {Number} Indicates the elevation limit when generating a route. Default value is null.
                //    Elevation unit can be either meters or feet is determined by the {distUnits} parameter.
                //    Miles = feet, Kilometers =  meters. Available for data versions Current, PCM_NA, PCM29.
                //    Limit will be ignored if: Routing is deemed impractical with the limit,
                //    or a stop is located at an elevation higher than the limit.
                "ElevLimit": null,
                // GovernorSpeedLimit - {Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value.
                //    Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}
                "GovernorSpeedLimit": 65,
                // SideOfStreetAdherence - {Number} Represents the levels of adherence that apply a cost to a route if its destination is on the opposite side of the street;
                //    Can be Off (0), Minimal (1), Moderate (2), Average (3), Strict (4), Adhere (5), StronglyAdhere (6)
                "SideOfStreetAdherence": 2,
                // FerryDiscourage - {Boolean} Indicates whether or not to discourage the use of ferries when creating the route.
                //    Default: false
                "FerryDiscourage": false,
                // HoSOptions - {Object} Represents the Hours of Service options for the route.
                "HoSOptions": {
                    // Enabled - {Boolean} Whether HoursOfService is enabled.
                    "Enabled": false,
                    // ConsecutiveDriveTime - {Number} Indicate number of hours before the driver needs to take a break.
                    //    The format is in decimal hours.
                    "ConsecutiveDriveTime": null,
                    // TotalDriveTime - {Number} Indicate the total drive hours allowed for the driver in a day.
                    //    The format is in decimal hours.
                    "TotalDriveTime": null,
                    // TotalOnDutyTime - {Number} Indicate the total On-Duty hours for the driver in a day.
                    //    The format is in decimal hours.
                    "TotalOnDutyTime": null
                },
                // UseSites - {Boolean} Indicates whether to use sites as part of the route calculation.
                //    If useSites is enabled and any of the stops on the route fall within an ALK site or applicable customer site,
                //    then the route itself will be affected by those sites. Entry / exit gates to / from that stop will be added as part of the route.
                //    Eventually the preferred first mile / last mile route path and reports will be affected.
                "UseSites": false
            },
            // FuelOptions - {Object} The fuel options indicate when fuel stop optimization or a fuel report is desired.
            "FuelOptions": null
        }]
    }
}

getRoutePath

services.getRoutePath = function (params)

Takes coords objects and route options, return lat/lons for the route path.  IE Trident and Edge have request length limitations on HTTP GET method.  If too many (about more than 80) stops are supplied, this method may reduce precision of each stop before sending them over.

Parameters

params{Object}

Valid params include

stops{String} “lon,lat;...;lon,lat”
options{Object}

Valid options include

region{String} The data region in which pings are located.  Choices are NA; AF, AS, EU, NA, OC ,SA and ME for world-wide.  AF indicates Africa, AS indicates Asia, EU indicates Europe, NA indicates the North America, OC indicates Oceania, SA indicates South America.  The default is NA.
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
highwayOnly{Boolean} To indicate whether to use highway only routing or not.  The default is false.
vehicleType{Number} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2).
routingType{Number} The desired routing algorithm which can be Practical (0) or Shortest (1).
classOverrides{Number} A comma-separated list of class overrides which can be None (0x0), NationalNetwork (0x1) and/or FiftyThreeFoot (0x2).  Default is None.
distanceUnits{Number} Distance units as Miles (0) or Kilometers (1).
tollDiscourage{Boolean} Indicates whether or not to avoid tolls while routing; can be true or false.  Default is false.
bordersOpen{Boolean} Indicates whether borders are open for travel; can be true or false.
overrideRestrict{Boolean} Indicates whether or not to override truck restrictions; can be true or false.  Default is false.
hazMatType{Number} Indicates the hazardous material type; can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), HarmfulToWater (7).
tunnelCategory{Number} Indicates the tunnel categories which are applicable for EU region only.  Values can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
trkUnits{Number} Vehicle dimension units; can be English (0) or Metric (1).
trkHeight{String} or {Number} The height of the truck in feet and inches or meters depending on units.  The default is 13’6” in all regions except Europe, which is 12’6”.  Example 13’6” or 4.1148.
trkLength{String} or {Number} The length of the truck in feet and inches or meters depending on units.  Default is 48 feet in all regions except Europe, which is 54’1”.  Example 13’6” or 4.1148.
trkWidth{String} or {Number} The width of the truck in feet and inches or meters depending on units.  This value can be 96” and below, 102” and above or 98”.  The default value is 96” for all regions.  Example 13’6” or 4.1148.
trkWeight{String} or {Number} The weight of the truck in pounds or kilograms depending on units.  Acceptable values can be up to 132,000 pounds or 59,874 kilos.  The default value is 80,000 pounds for all regions.
trkAxles{Number} The number of axles on the truck; acceptable values are 2 through 14 and the default value is 5.
trkLCV{Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle; can be true or false.
useAvoidFavors{Boolean} Can be true or false and indicates whether or not to use avoids and favors while routing.
routeOptimization{Number} Indicates the method by which to optimize route stops; can be None (0), ThruAll (1) or DestinationFixed (2).
hubRouting{Boolean} Indicates whether or not to enable hub routing; can be true or false.
estimatedTimeOpts{String} Estimated time options, format Depart(Arrive)|[DayOfWeek][SpecificDateTime]|[TimeOfDay], ex: Depart|Monday|18:30 to depart given day of week and time of day; or Arrive|2014-03-04T08:15:30-05:00 to arrive at specific date/time, or Arrive or Depart to arrive or depart with system time.
useTraffic{Boolean} Boolean indicating whether or not traffic should be taken into consideration when generating the route path.
truckConfig{Number} The vehicle style.  Default: 0 (0 - no vehicle style is chosen, 1 - 28’ double trailer, 2 - 40’ straight trailer, 3 - 48’ semitrailer, 4 - 53’ semitrailer).
elevLimit{Number} Indicates the elevation limit when generating a route.  Default value is null.  Elevation unit can be either meters or feet is determined by the {distUnits} parameter.  Miles = feet, Kilometers = meters.  Available for dataversions Current, PCM_NA, PCM29.  Limit will be ignored if: Routing is deemed impractical with the limit, or a stop is located at an elevation higher than the limit.
ferryDiscourage{Boolean} Indicates whether or not to discourage the use of ferries when creating the route.  Default: false
afSetIDs{Array<Number>} The avoid/favor set ids to apply to the route.
governorSpeedLimit{Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value.  Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}.
sideOfStreetAdherence{Number} Represents the levels of adherence that apply a cost to a route if its destination is on the opposite side of the street; can be Off (0), Minimal (1), Moderate (2), Average (3), Strict (4), Adhere (5), StronglyAdhere (6)
useSites{Boolean} Indicates whether to use sites as part of the route calculation.  If useSites is enabled and any of the stops on the route fall within an ALK site or applicable customer site, then the route itself will be affected by those sites.  Entry / exit gates to / from that stop will be added as part of the route.  Eventually the preferred first mile / last mile route path and reports will be affected.
{
    stops: '-75.339368,40.11442;-74.911539,40.159933;-74.885531,39.993483;-75.191123,39.802326',
    options: {
       'vehicleType': 'Truck',
       'routingType': 'Practical',
       'routeOptimization': 1,
       'highwayOnly': false,
       'distanceUnits': 'Miles',
       'tollDiscourage': true
    }
}

Returns

// responseText looks like:
{
    "type":"Feature",
    "geometry":{
        "type":"MultiLineString",
        "coordinates":[
            [[-75.339368,40.11442], ..., [-75.339308,40.114511]],
            [[-75.191123,39.802326], ..., [-75.191301,39.802518]],
            [[-74.911705,40.160123], ..., [-74.911539,40.159933]]
        ]
     }
}

postRoutePath

services.postRoutePath = function (inputs)

Takes coords objects and route options, return lat/lons for the route path.

Parameters

inputs{Object}

Valid inputs include

request{Object} The object that makes up post body for the route path request.
dataset{String} or {Number} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
success{Function} Callback function called after success with the return object as a parameter.  (optional)
failure{Function} Callback function called after failure with the return object as a parameter.  (optional)

Example request body

{
    "request": {
        // Route - {Object} The object that makes up the route path request.
        "Route":{
            // Stops - {Object} The array of coordinates that make up the stops of the route.
            "Stops": [{
                // Coords - {ALKMaps.LonLat} Longitude and latitude coordinates of the stop.
                "Coords": {
                    "Lat": "42.12345",
                    "Lon": "-76.12345"
                },
                // Region - {String/Number} The data region in which pings are located.
                //    Choices are NA; AF, AS, EU, NA, OC ,SA and ME for world-wide. AF indicates Africa,
                //    AS indicates Asia, EU indicates Europe, NA indicates the North America,
                //    OC indicates Oceania, SA indicates South America. The default is NA.
                "Region": 0
            }, {
                "Coords": {
                    "Lat": "42.12312",
                    "Lon": "-76.12312"
                },
                "Region": 0
            }, {
                "Coords": {
                    "Lat": "42.12456",
                    "Lon": "-76.12456"
                },
                "Region": 0
            }],
            // Options - {Object} Represents options specific to the kind of route to be run.
            "Options": {
                // BordersOpen - {Boolean} Indicates whether borders are open for travel; can be true or false.
                "BordersOpen": true,
                // DistanceUnits - {Number} Distance units as Miles (0) or Kilometers (1).
                "DistanceUnits": 0,
                // HazMatType - {Number} Indicates the hazardous material type;
                // can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), HarmfulToWater (7).
                "HazMatType": 0,
                // TunnelCategory - {Number} Indicates tunnel categories, applicable for EU region only.
                // can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
                "TunnelCategory": 0,
                // HighwayOnly - {Boolean} To indicate whether to use highway only routing or not. The default is false.
                "HighwayOnly": false,
                "TruckCfg": {
                    // Weight - {String} or {Number} The weight of the truck in pounds or kilograms depending on units.
                    //    Acceptable values can be up to 132,000 pounds or 59,874 kilos.
                    //    The default value is 80,000 pounds for all regions.
                    "Weight": "9000",
                    // Axles - {Number} The number of axles on the truck;
                    //    acceptable values are 2 through 14 and the default value is 5.
                    "Axles": 6,
                    // Units - {Number} Vehicle dimension units; can be English (0) or Metric (1).
                    "Units": 0,
                    // LCV - {Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle;
                    //    Can be true or false.
                    "LCV": false,
                    // Width - {String} or {Number} The width of the truck in feet and inches or meters depending on units.
                    //    This value can be 96" and below, 102" and above or 98".
                    //    The default value is 96" for all regions. Example 13'6" or 4.1148.
                    "Width": "8'0"
                },
                // RouteOptimization - {Number} 0 - None, 1 - Optimize All Stops, 2 - Optimize Intermediate Stops.
                //    Default is 0.
                "RouteOptimization": 0,
                // RoutingType - {Number} The desired routing algorithm which can be Practical (0) or Shortest (1).
                "RoutingType": 0,
                // VehicleType - {Number} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2).
                "VehicleType": 0,
                // ClassOverrides - {Number} A comma-separated list of class overrides which can be None (0x0),
                //    NationalNetwork (0x1) and/or FiftyThreeFoot (0x2). Default is None.
                "ClassOverrides": 3,
                // OverrideRestrict - {Boolean} Indicates whether or not to override truck restrictions;
                //    Can be true or false.  Default is false.
                "OverrideRestrict": false,
                // UseAvoidFavors - {Boolean} Can be true or false and indicates whether or not to use avoids and favors while routing.
                "UseAvoidsAndFavors": false,
                // FerryDiscourage - {Boolean} Indicates whether or not to discourage the use of ferries when creating the route.
                //    Default: false.
                "FerryDiscourage": false,
                // AFSetIDs - {Array<Number>} The avoid/favor set ids to apply to the route.
                "AFSetIDs": null,
                // GovernorSpeedLimit - {Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value.
                //    Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}
                "GovernorSpeedLimit": 65,
                // SideOfStreetAdherence - {Number} Represents the levels of adherence that apply a cost to a route if its destination is on the opposite side of the street;
                //    Can be Off (0), Minimal (1), Moderate (2), Average (3), Strict (4), Adhere (5), StronglyAdhere (6)
                "SideOfStreetAdherence": 2,
                // UseSites - {Boolean} Indicates whether to use sites as part of the route calculation.
                //    If useSites is enabled and any of the stops on the route fall within an ALK site or applicable customer site,
                //    then the route itself will be affected by those sites. Entry / exit gates to / from that stop will be added as part of the route.
                //    Eventually the preferred first mile / last mile route path and reports will be affected.
                "UseSites": false
            }

        }
    }
}

postRoutePathRaw

services.postRoutePathRaw = function (inputs)

Same as services.postRoutePath function.  Return of this method is consistent with the getRoutePath method.  If routing layer needs to switch to POST, this is the method that should be called.

getDerivedRoutePath

services.getDerivedRoutePath = function (params)

Take pings and route options, return derived route points.  IE Trident and Edge have request length limitations on HTTP GET method.  If too many (about more than 80) stops are supplied, this method may reduce precision of each stop before sending them over.

Parameters

pings{String} “lon,lat;...;lon,lat” if ioformat.input is not provided.
options{Object} {region: “NA”, offRouteMiles: number, highwayOnly: boolean}.  See notes bellow.
success{Function} Success callback function
failure{Function} Failure callback function

Valid options include

region{String} The data region in which pings are located.  Choices are NA; AF, AS, EU, NA, OC ,SA and ME for world-wide.  AF indicates Africa, AS indicates Asia, EU indicates Europe, NA indicates the North America, OC indicates Oceania, SA indicates South America.  The default is NA.
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
offRouteMiles{Number} The miles to the route used in calculating the acceptable window for the pings.  Throws the point out if it is not on the route and within the off route miles.
highwayOnly{Boolean} To indicate whether to use highway only routing or not.  The default is false.
vehicleType{Number} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2).
routingType{Number} The desired routing algorithm which can be Practical (0) or Shortest (1).
classOverrides{Number} A comma-separated list of class overrides which can be None (0x0), NationalNetwork (0x1) and/or FiftyThreeFoot (0x2).  Default is None.
distanceUnits{Number} Distance units as Miles (0) or Kilometers (1).
tollDiscourage{Boolean} Indicates whether or not to avoid tolls while routing; can be true or false.  Default is false.
bordersOpen{Boolean} Indicates whether borders are open for travel; can be true or false.
overrideRestrict{Boolean} Indicates whether or not to override truck restrictions; can be true or false.  Default is false.
hazMatType{Number} Indicates the hazardous material type; can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), HarmfulToWater (7).
tunnelCategory{Number} Indicates the tunnel categories which are applicable for EU region only.  Values can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
trkUnits{Number} Vehicle dimension units; can be English (0) or Metric (1).
trkHeight{String} or {Number} The height of the truck in feet and inches or meters depending on units.  The default is 13’6” in all regions except Europe, which is 12’6”.  Example 13’6” or 4.1148.
trkLength{String} or {Number} The length of the truck in feet and inches or meters depending on units.  Default is 48 feet in all regions except Europe, which is 54’1”.  Example 13’6” or 4.1148.
trkWidth{String} or {Number} The width of the truck in feet and inches or meters depending on units.  This value can be 96” and below, 102” and above or 98”.  The default value is 96” for all regions.  Example 13’6” or 4.1148.
trkWeight{String} or {Number} The weight of the truck in pounds or kilograms depending on units.  Acceptable values can be up to 132,000 pounds or 59,874 kilos.  The default value is 80,000 pounds for all regions.
trkAxles{Number} The number of axles on the truck; acceptable values are 2 through 14 and the default value is 5.
trkLCV{Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle; can be true or false.
estimatedTimeOpts{String} Estimated time options, format Depart(Arrive)|[DayOfWeek][SpecificDateTime]|[TimeOfDay], ex: Depart|Monday|18:30 to depart given day of week and time of day; or Arrive|2014-03-04T08:15:30-05:00 to arrive at specific date/time, or Arrive or Depart to arrive or depart with system time.
useTraffic{Boolean} Indicates whether or not traffic should be taken into consideration when generating the route path.
elevLimit{Number} Indicates the elevation limit when generating a route.  Default value is null.  Elevation unit can be either meters or feet is determined by the {distUnits} parameter.  Miles = feet, Kilometers = meters.  Available for dataversions Current, PCM_NA, PCM29.  Limit will be ignored if: Routing is deemed impractical with the limit, or a stop is located at an elevation higher than the limit.
ferryDiscourage{Boolean} Indicates whether or not to discourage the use of ferries when creating the route.  Default: false
afSetIDs{Array<Number>} The avoid/favor set ids to apply to the route.
governorSpeedLimit{Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value.  Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}
sideOfStreetAdherence{Number} Represents the levels of adherence that apply a cost to a route if its destination is on the opposite side of the street; can be Off (0), Minimal (1), Moderate (2), Average (3), Strict (4), Adhere (5), StronglyAdhere (6)

Returns

[[lon,lat],[lon,lat], ...  , [lon,lat], [lon,lat]]

postDerivedRoutePath

services.postDerivedRoutePath = function (inputs)

Retrieve a list of reduce trip coordinates in GeoJson format based on a series of longitudes/latitude pings and off route mileages window.

Parameters

inputs{Object}

Valid inputs include

request{Object} The object that makes up post body for the derived route path request.
dataset{String} or {Number} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
success{Function} Callback function called after success with the return object as a parameter.  (optional)
failure{Function} Callback function called after failure with the return object as a parameter.  (optional)

Example request body

{
    "request": {
         "RoutePings":[
           // Coords - {Array<ALKMaps.LonLat>} Longitude and latitude coordinates of the RoutePings.
           {
              "Lat":"33.714154",
              "Lon":"-118.309434"
           },
           {
              "Lat":"33.721061",
              "Lon":"-118.316631"
           }
         ],
         // OffRouteMiles - {Number} Gets or sets the value indicating the off route miles for the route.
         "OffRouteMiles":0,
         // HighwayOnly - {Boolean} To indicate whether to use highway only routing or not. The default is false.
         "HighwayOnly":false,
         // ReportTypes - {Array<Object>} Indicate different report types that the user would like to generate.
         //    Valid are: MileageReportType, DetailReportType, CalculateMilesReportType, DirectionsReportType
         //    FuelReportType, GeoTunnelReportType, LeastCostReportType, RoadReportType and StateReportType.
         //    The __type shall keep the same format as below.
         "ReportType":null,
         // Region - {String/Number} The data region in which pings are located.
         //    Choices are NA; AF, AS, EU, NA, OC ,SA and ME for world-wide. AF indicates Africa,
         //    AS indicates Asia, EU indicates Europe, NA indicates the North America,
         //    OC indicates Oceania, SA indicates South America. The default is NA.
         "Region":4,
         "RoutingOptions":{
           // VehicleType - {Number} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2).
           "VehicleType":0,
           // RoutingType - {Number} The desired routing algorithm which can be Practical (0) or Shortest (1).
           "RoutingType":0,
           // HighwayOnly - {Boolean} To indicate whether to use highway only routing or not. The default is false.
           "HighwayOnly":false,
           // UseAvoidFavors - {Boolean} Can be true or false and indicates whether or not to use avoids and favors while routing.
           "UseAvoidsAndFavors":false,
           // ClassOverrides - {Number} A comma-separated list of class overrides which can be None (0x0),
           //    NationalNetwork (0x1) and/or FiftyThreeFoot (0x2). Default is None.
           "ClassOverrides":0,
           // DistanceUnits - {Number} Distance units as Miles (0) or Kilometers (1).
           "DistanceUnits":0,
           // TollDiscourage - {Boolean} Gets or sets a value indicating whether or not tolls should be discouraged on the route.  The default is false.
           "TollDiscourage":false,
           // BordersOpen - {Boolean} Indicates whether borders are open for travel; can be true or false.
           "BordersOpen":true,
           // OverrideRestrict - {Boolean} Indicates whether or not to override truck restrictions;
           //    Can be true or false.  Default is false.
           "OverrideRestrict":false,
           // HazMatType - {Number} Indicates the hazardous material type;
           // can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), or HarmfulToWater (7).
           "HazMatType":0,
           // TunnelCategory - {Number} Indicates tunnel categories, applicable for EU region only.
           // can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
           "TunnelCategory":0,
           // RouteOptimization - {Number} 0 - None, 1 - Optimize All Stops, 2 - Optimize Intermediate Stops.
           //    Default is 0.
           "RouteOptimization":0,
           "TruckCfg": {
               // Weight - {String} or {Number} The weight of the truck in pounds or kilograms depending on units.
               //    Acceptable values can be up to 132,000 pounds or 59,874 kilos.
               //    The default value is 80,000 pounds for all regions.
               "Weight": "9000",
               // Axles - {Number} The number of axles on the truck;
               //    acceptable values are 2 through 14 and the default value is 5.
               "Axles": 6,
               // Units - {Number} Vehicle dimension units; can be English (0) or Metric (1).
               "Units": 0,
               // LCV - {Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle;
               //    Can be true or false.
               "LCV": false,
               // Width - {String} or {Number} The width of the truck in feet and inches or meters depending on units.
               //    This value can be 96" and below, 102" and above or 98".
               //    The default value is 96" for all regions. Example 13'6" or 4.1148.
               "Width": "8'0"
           },
           // hubRouting -  {Boolean} Indicates whether or not to enable hub routing; can be true or false.
           "HubRouting":false,
           // AFSetIDs - {Array<Number>} The avoid/favor set ids to apply to the route.
           "AFSetIDs":null,
           // ElevLimit - {Number} Indicates the elevation limit when generating a route.
           //    Default value is null. Elevation unit can be either meters or feet is determined by the {DistanceUnits} parameter.
           //    Miles = feet, Kilometers =  meters. Available for dataversions Current, PCM_NA, PCM29.
           //    Limit will be ignored if: Routing is deemed impractical with the limit, or a stop is located at an elevation higher than the limit.
           "ElevLimit":null,
           // FerryDiscourage - {Boolean} Indicates whether or not to discourage the use of ferries when creating the route.
           //    Default: false.
           "FerryDiscourage":false,
           // GovernorSpeedLimit - {Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value.
           //    Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}
           "GovernorSpeedLimit": 65,
           //sideOfStreetAdherence - {Number} Represents the levels of adherence that apply a cost to a route if its destination is on the opposite side of the street;
           //    can be Off (0), Minimal (1), Moderate (2), Average (3), Strict (4), Adhere (5), StronglyAdhere (6)
           "sideOfStreetAdherence": 2
         },
         "ExtendedOptions":{
           "EstimatedTimeOptions":{
              // ETAETD - {String/Number} Gets or sets whether estimated time of arrival or estimated time of departure is desired.
              //    0 - Arrival, 1 - Depart
              "ETAETD":1,
              // DateOption - {String/Number} Gets or sets the date option which can be the current time, a specific time or a specific day of the week.
              //    0 - Current, 1 - Specific, 2 - DayOfWeek.
              "DateOption":1,
              "DateAndTime":{
                 // CalendarDate - {String} Gets or sets the date. This value is the month, day and year in the following format mm/dd/yyyy.
                 "CalendarDate":"4/23/2014",
                 // DayOfWeek = {String/Number} Gets or sets the day of the week to use for historic traffic or estimated time options with a DayOfWeek DateOption.
                 //    0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.
                 "DayOfWeek":0,
                 // TimeOfDay - {String} Gets or sets the time of the day.
                 "TimeOfDay":"6:00 AM",
                 // TimeZone - {String/Number} TimeZoneGets or sets the time zone for the time.
                 //    Note the time zone for traffic will always be the system's time zone regardless of the value set here.
                 //    0 - Local, 1 - System, 2 - Hawaii, 3 - Alaska, 4 - Pacific, 5 - Arizona, 6 - Mountain, 7 - Central
                 //    8 - Eastern, 9 - Atlantic, 10 - Newfoundland
                 "TimeZone":0
              }
           },
           // useTraffic - {Boolean} Indicates whether or not use traffic when calculating trip transit times.
           "UseTraffic":true,
           // TruckStyle - {Number or String} The vehicle style. Default: 0 (0 - no vehicle style is chosen,
           //    1 - 28' double trailer, 2 - 40' straight trailer, 3 - 48' semitrailer, 4 - 53' semitrailer).
           "TruckStyle":0
         }
     }
}

postDerivedRouteReports

services.postDerivedRouteReports = function (inputs)

The postDerivedRouteReports operation will return either mileage or detail report for the reduced trip based upon a series of latitude/longitudes pings.

Parameters

inputs{Object}

Valid inputs include

request{Object} The object that makes up post body for the derived route report request.
dataset{String} or {Number} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
success{Function} Callback function called after success with the return object as a parameter.  (optional)
failure{Function} Callback function called after failure with the return object as a parameter.  (optional)

Example request body

{
"request":{
    "ExtendedOptions":{
    "EstimatedTimeOptions":{
    // ETAETD - {String/Number} Gets or sets whether estimated time of arrival or estimated time of departure is desired.
    //    0 - Arrival, 1 - Depart
    "ETAETD":1,
    // DateOption - {String/Number} Gets or sets the date option which can be the current time, a specific time or a specific day of the week.
    //    0 - Current, 1 - Specific, 2 - DayOfWeek.
    "DateOption":1,
    "DateAndTime":{
        // CalendarDate - {String} Gets or sets the date. This value is the month, day and year in the following format mm/dd/yyyy.
        "CalendarDate":"4\/23\/2014",
        // DayOfWeek = {String/Number} Gets or sets the day of the week to use for historic traffic or estimated time options with a DayOfWeek DateOption.
        //    0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.
        "DayOfWeek":0,
        // TimeOfDay - {String} Gets or sets the time of the day.
        "TimeOfDay":"6:00 AM",
        // TimeZone - {String/Number} TimeZoneGets or sets the time zone for the time.
        //    Note the time zone for traffic will always be the system's time zone regardless of the value set here.
        //    0 - Local, 1 - System, 2 - Hawaii, 3 - Alaska, 4 - Pacific, 5 - Arizona, 6 - Mountain, 7 - Central
        //    8 - Eastern, 9 - Atlantic, 10 - Newfoundland
        "TimeZone":0}
        },
        // TruckStyle - {Number or String} The vehicle style. Default: 0 (0 - no vehicle style is chosen,
        //    1 - 28' double trailer, 2 - 40' straight trailer, 3 - 48' semitrailer, 4 - 53' semitrailer).
        "TruckStyle":0,
        // useTraffic - {Boolean} Indicates whether or not use traffic when calculating trip transit times.
        "UseTraffic":true
    },
    // HighwayOnly - {Boolean} To indicate whether to use highway only routing or not. The default is false.
    "HighwayOnly":false,
    // OffRouteMiles - {Number} Gets or sets the value indicating the off route miles for the route.
    "OffRouteMiles":0,
    // Region - {String/Number} The data region in which pings are located.
    //    Choices are NA; AF, AS, EU, NA, OC ,SA and ME for world-wide. AF indicates Africa,
    //    AS indicates Asia, EU indicates Europe, NA indicates the North America,
    //    OC indicates Oceania, SA indicates South America. The default is NA.
    "Region":4,
    // ReportTypes - {Array<Object>} Indicate different report types that the user would like to generate.
    //    Valid are: MileageReportType and DetailReportType only.
    //    The __type shall keep the same format as below.
    "ReportType":{"__type":"MileageReportType:http:\/\/pcmiler.alk.com\/APIs\/v1.0","THoursWithSeconds":false},
    "RoutePings":[
      // Coords - {Array<ALKMaps.LonLat>} Longitude and latitude coordinates of the RoutePings.
      {
         "Lat":"33.714154",
         "Lon":"-118.309434"
      },
      {
         "Lat":"33.721061",
         "Lon":"-118.316631"
      }
    ],
    "RoutingOptions":{
      // VehicleType - {Number} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2).
      "VehicleType":0,
      // RoutingType - {Number} The desired routing algorithm which can be Practical (0) or Shortest (1).
      "RoutingType":0,
      // HighwayOnly - {Boolean} To indicate whether to use highway only routing or not. The default is false.
      "HighwayOnly":false,
      // UseAvoidFavors - {Boolean} Can be true or false and indicates whether or not to use avoids and favors while routing.
      "UseAvoidsAndFavors":false,
      // ClassOverrides - {Number} A comma-separated list of class overrides which can be None (0x0),
      //    NationalNetwork (0x1) and/or FiftyThreeFoot (0x2). Default is None.
      "ClassOverrides":0,
      // DistanceUnits - {Number} Distance units as Miles (0) or Kilometers (1).
      "DistanceUnits":0,
      // TollDiscourage - {Boolean} Gets or sets a value indicating whether or not tolls should be discouraged on the route.  The default is false.
      "TollDiscourage":false,
      // BordersOpen - {Boolean} Indicates whether borders are open for travel; can be true or false.
      "BordersOpen":true,
      // OverrideRestrict - {Boolean} Indicates whether or not to override truck restrictions;
      //    Can be true or false.  Default is false.
      "OverrideRestrict":false,
      // HazMatType - {Number} Indicates the hazardous material type;
      // can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), HarmfulToWater (7).
      "HazMatType":0,
      // TunnelCategory - {Number} Indicates tunnel categories, applicable for EU region only.
      // can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
      "TunnelCategory":0,
      // RouteOptimization - {Number} 0 - None, 1 - Optimize All Stops, 2 - Optimize Intermediate Stops.
      //    Default is 0.
      "RouteOptimization":0,
      "TruckCfg": {
          // Weight - {String} or {Number} The weight of the truck in pounds or kilograms depending on units.
          //    Acceptable values can be up to 132,000 pounds or 59,874 kilos.
          //    The default value is 80,000 pounds for all regions.
          "Weight": "9000",
          // Axles - {Number} The number of axles on the truck;
          //    acceptable values are 2 through 14 and the default value is 5.
          "Axles": 6,
          // Units - {Number} Vehicle dimension units; can be English (0) or Metric (1).
          "Units": 0,
          // LCV - {Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle;
          //    Can be true or false.
          "LCV": false,
          // Width - {String} or {Number} The width of the truck in feet and inches or meters depending on units.
          //    This value can be 96" and below, 102" and above or 98".
          //    The default value is 96" for all regions. Example 13'6" or 4.1148.
          "Width": "8'0"
      },
      // hubRouting -  {Boolean} Indicates whether or not to enable hub routing; can be true or false.
      "HubRouting":false,
      // AFSetIDs - {Array<Number>} The avoid/favor set ids to apply to the route.
      "AFSetIDs":null,
      // ElevLimit - {Number} Indicates the elevation limit when generating a route.
      //    Default value is null. Elevation unit can be either meters or feet is determined by the {DistanceUnits} parameter.
      //    Miles = feet, Kilometers =  meters. Available for dataversions Current, PCM_NA, PCM29.
      //    Limit will be ignored if: Routing is deemed impractical with the limit, or a stop is located at an elevation higher than the limit.
      "ElevLimit":null,
      // FerryDiscourage - {Boolean} Indicates whether or not to discourage the use of ferries when creating the route.
      //    Default: false.
      "FerryDiscourage":false,
      // GovernorSpeedLimit - {Number} Maximum average road speed to use in route calculations that overrides all other road speeds when they are above this value.
      //    Default is null and valid value is between 1 and 100 mph or between 1 and 161 kph determined by the {distUnits}
      "GovernorSpeedLimit": 65,
      // SideOfStreetAdherence - {Number} Represents the levels of adherence that apply a cost to a route if its destination is on the opposite side of the street;
      //    Can be Off (0), Minimal (1), Moderate (2), Average (3), Strict (4), Adhere (5), StronglyAdhere (6)
      "SideOfStreetAdherence": 2
    }
}

getRoadSurfaceRoute

services.getRoadSurfaceRoute = function (inputs)

Allows a user to request road surface conditions for each point of a route path.

Parameters

inputs{Object}

Valid inputs include

routeDuration{Number} The duration of the route in minutes (integer).  This is required as it is used to calculate the temporal offset for each point in the route path.
routePath{Object} An array of double array consisting of the route path where each inner element is the longitude an latitude, ex [[-76.0,41.0],[75.0,41.7]]
provider{String} Optional to switch provider from “Default” to “RC1”
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)
{ "routePath": [[-83.000363,39.960776],[-83.000547,39.961744],[-83.000642,39.962226]]], "routeDuration": 315 }

Returns

The conditions are returned in an integer array where Dry road=1 Wet road=2 Ice/snow=3 Mix water/snow=4 Dew=5 Melting snow=6 Frost=7 Icing rain=8 Not in range=99

[1,1,1,1,1,3,3,5,1,1,5]

addAvoidFavorSet

services.addAvoidFavorSet = function (params)

Add a new avoid/favor set.  Combination of name and tag has to be unique.

Parameters

name{String} Description of the set
tag{String} Additional information to categorize or group closures in a set
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
{
  'name':'Unit tests',
  'tag':'unitTests'},
  'dataset': 'Current',
  'async': true,
  'success': function(resp){
  },
  'failure': function(resp){
  }
}

Returns

{Number}set Id.

getAvoidFavorSets

services.getAvoidFavorSets = function (params)

Retrieves all AvoidFavorSets, one specific set if the setId is specified.

Parameters

setId{String} -1 to retrieve all.
name{String} To retrieve all AvoidFavor associated with the name, this will be ignored if a set id is passed in.
tag{String} To retrieve all AvoidFavor associated with the tag, this will be ignored if a set id is passed in.
detail{Boolean} If true, returns more information.
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
{
  'setId': '2099',
  'name': 'test',
  'tag': 'unitTest',
  'detail': true,
  'dataset': 'Current'
  'async': true,
  'success': function(resp){
  },
  'failure': function(resp){
  }
}

Returns

[
  {
    "Links":[
       {
         "AvoidFavorID":476583,
         "AvoidFavorType":1,
         "Comment":"unitTest",
         "Geometries":[
           [
             [-78.011913,40.711918],
             [-78.005676,40.714624],
             [-77.999278,40.717677]
           ],
           [
             [-78.011913,40.711918],
             [-78.005676,40.714624],
             [-77.999278,40.717677]
           ]
         ]
       }
     ],
     "Name":"Random 365690",
     "SetID":12914,
     "Tag":"unitTests"
  }
]

updateAvoidFavorSet

services.updateAvoidFavorSet = function (params)

Update name and tag based on set Id.  If no record is found, the bad request error with message will be returned.

Parameters

setId{String} the existing avoid/favor set ID
tag{String} the new tag for the avoid/favor set
name{String} the new name for the avoid/favor set
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
{
  'setId': '12916',
  'tag': 'unitTests',
  'name': 'unitTest again',
  'dataset': 'Current',
  'success': function(resp){
  },
  'failure': function(resp){
  }
}

Returns

{ Number } The number of rows affected.

deleteAvoidFavorSet

services.deleteAvoidFavorSet = function (params)

Deletes the AvoidFavor set.

Parameters

setId{String} Set id.
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
{
  'setId': '12'
  'dataset': 'Current'
  'success': function(resp){
  },
  'failure': function(resp){
  }
}

Returns

{Number} The number of items have been deleted.

addAvoidFavor

services.addAvoidFavor = function (params)

Add a new set with closure.

Parameters

{
  'setId': 1, // The existing avoid/favor set id. The system will try to add closures to the given set.
  'projection': 'EPSG:4326', // Accepted projection code format
  'region': 'NA', // Map region
  'dataset': 'Current', // Regional Dataset
  'mapBounds': new ALKMaps.Bounds( // Map viewport box
    -78.02197265625, // Longitude - the left bounds of the box
    40.68802734375,  // Latitude - the bottom bounds of the box
    -77.97802734375,  // Longitude - the right bounds
    40.73197265625), // Latitude - the top bounds
  'afPoint': {
    'type':'c', // Supply "c" to request a closure. At this time, it does not matter because the system will treat all user input as closure.
    'comment':'unitTest', // Description of the closure path
    'point': // Use this location to generate closure path
      new ALKMaps.LonLat(-78.000183105469, 40.71745844841)},
  'async': true,
  'success': function(resp){
  },
  'failure': function(resp){
  }
}

Returns

[
  {
    "AvoidFavorID":476583,
    "AvoidFavorType":1,
    "Comment":"unitTest",
    "Geometries":[
      [
        [-78.011913,40.711918],
        [-78.005676,40.714624],
        [-77.999278,40.717677]
      ],
      [
        [-78.011913,40.711918],
        [-78.005676,40.714624],
        [-77.999278,40.717677]
      ]
    ]
  }
]

deleteAvoidFavor

services.deleteAvoidFavor = function (params)

Deletes a specific AvoidFavors within a set.

Parameters

setId{String} The avoid favor set id in which the avoid favor resides.
afId{String} The avoid favor id to delete.
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
{
    setId : "1",
    afId :  "12",
    dataset :  "Current"
}

Returns

{Number} The number of rows affected.

poiRadiusSearch

services.poiRadiusSearch = function (params)

Gets points of interest within a specified radius of a given point.

Parameters

center{ALKMaps.LonLat} lonlat for center of radius search
region{String} The data region in which the center is located.  Choices are NA, AF, AS, EU, NA, OC ,SA and ME for world-wide.  AF indicates Africa, AS indicates Asia, EU indicates Europe, NA indicates the North America, OC indicates Oceania, SA indicates South America.  The default is NA.
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_GT (GeoTrac), PCM_AF, PCM_AS, PCM_ME, PCM_SE, PCM_NA, or Current (default).
radius{Number} radius distance from center of point.
radiusUnits{Number}Unit used for the radius distances.  Choices are Miles(0) and Kilometers(1).  The default is Miles.
poiCategories{String} Comma delimited string of categories.  All, City, Zip, Place, Airport, Automotive, WeighStation, Dining, Education, Emergency, Government, Gas, Lodging, Parks, Retail, RVServices, SportsRec, Travel, TruckServices , and Attractions.  The default is All.
success{Function} success callback function
failure{Function} failure callback function
ALKMaps.Services.poiRadiusSearch({
    center: new ALKMaps.LonLat(-70,40),
    region: "NA",
    dataset: "Current",
    radius: 12,
    radiusUnits: 0,
    poiCategories: "Dining,Gas",
    success: function(response) {},
    failure: function(response) {}
});

Returns Array<Object>:
[{
     DistanceFromCenter:
     {
         DistanceUnits: 0,
         Value: 1.56354
     },
     POILocation:
     {
         Address:
         {
             AbbreviationFormat:0,
             City: "Atlantic City",
             Country: null,
             CountryPostalFilter: 0,
             County: "",
             SPLC: null,
             State: "NJ",
             StreetAddress: "777 Harrahs Blvd",
             Zip: "08401-1911"
         },
         Coords:
         {
             Lat: "39.383491",
             Lon: "-74.42805"
          },
         Label: "Ben & Jerry's",
         PlaceName: "Ben & Jerry's",
         Region: 4
     }
}]

weatherAlerts

services.weatherAlerts = function (params)

Get weather alerts.

Parameters

bounds{ALKMaps.Bounds} In degrees.
point{Array<Number>} Latitude longitude pair in degrees.
route{Array<Array<Number>>} Array of latitude longitude pairs in degrees representing a route path.
options{Object} Allows client selectively requests weather alerts by providing values for urgency, severity, certainty, alert event names, and start/end times.
{
     bounds: new ALKMaps.Bounds(-125, 25, -65, 49)
     options: {urgency: "All", severity: "All", certainty: "All", eventNames: ["Winter Storm Warning", "Flood Watch"], startTime: "2015-08-29T13:45:30-07:00", endTime: "2015-08-31T13:45:30-07:00"}
}

Returns

{Array(Object)}

[{
     AlertEvent: "Flood Warning",
     AreaDesc: "Pike",
     Certainty: "Likely",
     Effective: "2014-04-28T08:59:00-08:00",
     Expires: "2014-04-28T08:59:00-08:00",
     FipsCodes: "029163",
     ID: "https://alerts.weather.gov/cap/wwacapget.php?x=MO1251599DC9E0.FloodWarning.125159D8C770MO.LSXFLSLSX.4879e286220c4cfa0e38e0d58bd0357c",
     Polygon: "POLYGON ((-91.11 39.45, -90.97 39.39, -90.89 39.45, -90.97 39.52, -91.11 39.45))",
     Published: "2014-04-28T08:59:00-08:00",
     Severity: "Moderate",
     Summary: "...The flood warning continues for the following river in Illinois and Missouri... Mississippi River at Hannibal Louisiana Clarksville Lock and Dam 24",
     Title: "Flood Warning issued June 05 at 11:40AM CDT until June 08 at 10:00PM CDT by NWS",
     Updated: "2014-04-28T08:59:00-08:00",
     Urgency: "Expected"
}]

weatherAlertsGeoJson

services.weatherAlertsGeoJson = function (params)

Gets weather alerts in GeoJson.

Parameters

params{Object} success and failure callback functions.
{
    success: function(response) { },
    failure: function(error) { }
}
(code)

Returns:
GeoJson feature.

countyPolygons

services.countyPolygons = function (params)

Gets county polygons.

Parameters

codes{String} County codes separated by comma.
{
     codes: "005049,047077,047075"
}

Returns

{Array(Object)}

[{
     Code: "005049",
     Name: "Fulton",
     Polygon: "POLYGON ((-91.7816600270182 36.4990805648274, -91.784713 36.499074, -91.799500000000009 36.498951999999996, -91.864385 36.498788999999995, -91.865995 36.498782999999996, -91.7816600270182 36.4990805648274))"
}]

zipPolygons

services.zipPolygons = function (params)

Gets zip polygons.

Parameters

codes{String} Zip codes separated by comma.
{
     codes: "08540,36426"
}

Returns

{Array(Object)}

[{
     "Code":"08540",
     "Name":null,
     "Polygon":"MULTIPOLYGON (((-74.601317000794651 40.361527999229487 0 0, -74.598276 40.359794 0 0, -74.596865999999991 40.36016 0 0, -74.594606001760027 40.362320999439291 0 0,
         -74.594841 40.363346 0 0, -74.597483 40.364826 0 0, -74.601317000794651 40.361527999229487 0 0))))"
}]

statePolygons

services.statePolygons = function (params)

Gets state polygons.

Parameters

states{String} State abbreviations separated by comma.
{
     states: "AB,MT"
}

Returns

{Array(Object)}

[{
     "Code":"48",
     "Name":"Alberta",
     "Polygon":"MULTIPOLYGON (((-74.601317000794651 40.361527999229487 0 0, -74.598276 40.359794 0 0, -74.596865999999991 40.36016 0 0, -74.594606001760027 40.362320999439291 0 0,
         -74.594841 40.363346 0 0, -74.597483 40.364826 0 0, -74.601317000794651 40.361527999229487 0 0))))"
}]

getDriveTimePolygon

services.getDriveTimePolygon = function (params)

Get a polygon of drivable locations from the center point within a specified time constraint.

Parameters

center{ALKMaps.LonLat} Center point of polygon.  The center acts as the starting point of all the virtual route paths ending at each point in the polygon.  Service expects coordinates to be in degrees.
minutes{Number} Driving time in minutes from the center point to each point of the polygon.
options{Object} Object containing optional routing and trucking configurations.
success{Function} success callback function
failure{Function} failure callback function

Valid Options Include

region{String/Number} The data region in which the center is located.  Choices are NA, AF, AS, EU, NA, OC ,SA and ME for world-wide.  AF indicates Africa, AS indicates Asia, EU indicates Europe, NA indicates the North America, OC indicates Oceania, SA indicates South America.  The default is NA.
dataset{String} For users licensed for multiple regional datasets, this parameter will allow you to choose between PCM_EU, PCM_OC, PCM_SA, PCM_AS, PCM_AF, PCM_ME, PCM_SE or Current (default).
highwayOnly{Boolean} To indicate whether to use highway only routing or not.  The default is false.
vehicleType{String/Number} The vehicle type which can be Truck (0), LightTruck (1) or Auto (2).
routingType{String/Number} The desired routing algorithm which can be Practical (0) or Shortest (1).
classOverrides{String} A comma-separated list of class overrides which can be None (0x0), NationalNetwork (0x1) and/or FiftyThreeFoot (0x2).  Default is None.
distanceUnits{String/Number} Distance units as Miles (0) or Kilometers (1).
tollDiscourage{Boolean} Indicates whether or not to avoid tolls while routing; can be true or false.  Default is false.
bordersOpen{Boolean} Indicates whether borders are open for travel; can be true or false.
overrideRestrict{Boolean} Indicates whether or not to override truck restrictions; can be true or false.  Default is false.
hazMatType{String/Number} Indicates the hazardous material type; can be None (0), General (1), Caustic (2), Explosives (3), Flammable (4), Inhalants (5), Radioactive (6), or HarmfulToWater (7).
tunnelCategory{Number} Indicates the tunnel categories which are applicable for EU region only.  Values can be None (0), TunnelBCDE (1), TunnelCDE (2), TunnelDE (3), TunnelE (4).
trkUnits{String/Number} Vehicle dimension units; can be English (0) or Metric (1).
trkHeight{Number} The height of the truck in feet and inches or meters depending on units.  The default is 13’6” in all regions except Europe, which is 12’6”.  Example 13’6” or 4.1148.
trkLength{Number} The length of the truck in feet and inches or meters depending on units.  Default is 48 feet in all regions except Europe, which is 54’1”.  Example 13’6” or 4.1148.
trkWidth{Number} The width of the truck in feet and inches or meters depending on units.  This value can be 96” and below, 102” and above or 98”.  The default value is 96” for all regions.  Example 13’6” or 4.1148.
trkWeight{Number} The weight of the truck in pounds or kilograms depending on units.  Acceptable values can be up to 132,000 pounds or 59,874 kilos.  The default value is 80,000 pounds for all regions.
trkAxles{Number} The number of axles on the truck; acceptable values are 2 through 14 and the default value is 5.
trkLCV{Boolean} Indicates whether the truck is a multi-trailer or longer combination vehicle; can be true or false.
elevLimit{Number} Indicates the elevation limit when generating a route.  Default value is null.  Elevation unit can be either meters or feet is determined by the {distUnits} parameter.  Miles = feet, Kilometers = meters.  Available for dataversions Current, PCM_NA, PCM29.  Limit will be ignored if: Routing is deemed impractical with the limit, or a stop is located at an elevation higher than the limit.
ALKMaps.Services.getDriveTimePolygon({
   center: new ALKMaps.LonLat(-74.65488,40.36841), //Service expects coordinates to be in degrees.
   minutes: 10,
   vehType: 'Truck',
   axles: 6,
   LCV: false
});

Returns

{Object}

{
  coordinates: [[[-74.692464,40.358963],[-74.691857,40.359096], ...]],
  type: "Polygon"
}

getTrafficIncidentsBox

services.getTrafficIncidentsBox = function (params)

Retrieves traffic incidents within the given bounding box

Parameters

bbox{Array<Number>} Viewport bounds in degrees for now.  The order of elements in the array is min longitude, min latitude, max longitude and max latitude.
language{string} Desired incidents language.
success{Function} success callback function
failure{Function} failure callback function
ALKMaps.Services.getTrafficIncidentsBox(
        {
            bbox: [-179.999999, 10, -6.44, 85],
            language: "en",
            success: function(resp) { console.log(resp); }
        }
);

getTrafficCamerasBox

services.getTrafficCamerasBox = function (params)

Retrieves traffic cameras within the given bounding box

Parameters

bbox{Array<Number>} Viewport bounds in degrees for now.  The order of elements in the array is min longitude, min latitude, max longitude and max latitude.
success{Function} success callback function
failure{Function} failure callback function
ALKMaps.Services.getTrafficCamerasBox({
    bbox: [-179.999999, 10, -6.44, 85]
    success: function(resp) { console.log(resp); }
});

getTrafficCameraMetadata

services.getTrafficCameraMetadata = function (params)

Retrieves traffic camera metadata for the given camera id.

Parameters

id{String} camera id.
success{Function} success callback function
failure{Function} failure callback function
ALKMaps.Services.getTrafficCameraMetadata({
    id: "100",
    success: function(resp) { console.log(resp); }
});

getAttribution

services.getAttribution = function (params)

Retrieves the necessary attribution for a given layer based on the layer’s type and its settings.

Parameters

className{String} Name of the layer’s class.
style{<ALKMaps.STYLE>} Style of base layer tiles.
imgSrc{String} Satellite tile provider.
imgOption{String} Used specify if instance of base layer contains map tiles or transparent overlay.  “Foreground” or “Background”.
region{String/Number} Data region of the given layer.
useHyperlink{Boolean} Use hyper-link if there is any.  Default is true.
var attribution = ALKMaps.Services.getAttribution({
    className: "ALKMaps.Layer.BaseMap",
    region: "NA",
    style: ALKMaps.STYLE.SATELLITE,
    imgOption: "Foreground"
});

postRailRoutePath

services.postRailRoutePath = function (params)

Takes stops objects and route options, return lat/lons in geo json.

Parameters

params{Object}

Valid params includes

stops{Object} with format, name and railroad properties.
options{Object}

Valid options include

routingPreference{String} Practicale
terminalSwitching{Boolean} Todo ???
amtrakRoutes{Boolean} Todo ???
intermodalOnlyStations{Boolean} Todo ???
distUnit{String} Miles
{
    "stops": [{
         "format": "StationState",
         "name": "Denver CO",
         "railroad": "UP"
     },
     {
         "format": "StationState",
         "name": "Oakland CA",
         "railroad": "UP"
     }],
     "options": {
          "routingPreference": "Practical",
          "terminalSwitching": true,
          "amtrakRoutes": true,
          "intermodalOnlyStations": true,
          "distUnit": "Miles"
     }
}

Returns

// responseText looks like:
{
    "type":"Feature",
    "geometry":{
        "type":"MultiLineString",
        "coordinates":[
            [[-75.339368,40.11442], ..., [-75.339308,40.114511]],
            [[-75.191123,39.802326], ..., [-75.191301,39.802518]],
            [[-74.911705,40.160123], ..., [-74.911539,40.159933]]
        ]
     }
}

getRailStations

services.getRailStations = function (params)

Takes SPLC code and returns first matched station if there is one.

Parameters

params{Object}

Valid params includes

splc{String} SPLC code.
success{Function} callback function called after success with the return object as a parameter.  (optional)
failure{Function} callback function called after failure with the return object as a parameter.  (optional)

Returns

GeocodeInfo: [{
  Latitude: 41057799
  Longitude: -81527376
  SPLC: "344770000"
  StationName: "SOUTH AKRON"
}]

getSitesBox

services.getSitesBox = function (params)

Gets ALK sites

Parameters

params:{Object}

Valid params includes

bbox{Array<Number>} Tile bounds in degrees for now.  The order of elements in the array is min longitude, min latitude, max longitude and max latitude.
qKey{String} Tile unique qKey.
siteType{Number} Type of site layer.  0 - both, 1- alk site, 2 - custom site.
success{Function} success callback function
failure{Function} failure callback function

getAvoidFavorSets

services.getAvoidFavorSets = function (params)

Gets avoid/favor sets for API key.

Parameters

params:{Object}

Valid params includes

success{Function} success callback function
failure{Function} failure callback function

getAvoidFavorGroup

services.getAvoidFavorGroup = function (params)

Gets avoid/favor for a given set.

Parameters

params:{Object}

Valid params includes

afSetId{String} Avoid/Favor set unique id.
success{Function} success callback function
failure{Function} failure callback function

getAvoidFavorBox

services.getAvoidFavorBox = function (params)

Gets avoid/favor for a given set within a given bounding box.

Parameters

params:{Object}

Valid params includes

bbox{Array<Number>} Tile bounds in degrees for now.  The order of elements in the array is min longitude, min latitude, max longitude and max latitude.
afSetId{String} Avoid/Favor set unique id.
success{Function} success callback function
failure{Function} failure callback function

getTruckRestrictions

services.getTruckRestrictions = function (params)

Gets truck restrictions for a given bounding box.

Parameters

params:{Object}

Valid params includes

bbox{Array<Number>} Bounding box in degrees for now.  The order of elements in the array is min longitude, min latitude, max longitude and max latitude.
units{Number} Can be English or Metric.  Default: 0 (0 - Indicates that response units should be English, 1 - Indicates that response units should be metric) language -{String} 2-letter ISO language code, such as “en”, “es”, “de”.  Default: “en”
requestId{String} Any string supplied by caller.  The service will echo back the same string.
dataset{String} or {Number} For users licensed for multiple regional datasets, this parameter will allow you to choose between different datasets such as PCM_NA, or Current (default).
success{Function} success callback function
failure{Function} failure callback function
ALKMaps.Services.getTruckRestrictions(
    {
        requestId: "0320101101322221"
        bbox: [-73.998413,40.718119,-73.992920,40.722283],
        language: "en",
        units: 1
        success: function(resp) { console.log(resp); }
    }
);

Services

The ALKMaps services class

services.getCustomPlaces = function (inputs)
Get custom places for a given account.
services.updateCustomPlaceSet = function (inputs)
Update custom place set’s name, and tag for a given set id and tag.
services.deleteCustomPlaceSet = function (inputs)
Delete custom place set for a given id.
services.deleteCustomPlace = function (inputs)
Delete custom place.
services.getCustomCategories = function (inputs)
Get custom categories.
services.addCustomCategory = function (inputs)
Add custom category.
services.updateCustomCategory = function (inputs)
Update custom categories.
services.getReports = function (params)
Takes coords objects and report options, return total time and total distance synchronously.
services.postReports = function (inputs)
Takes coords objects and report options, return total time and total distance synchronously.
services.getRoutePath = function (params)
Takes coords objects and route options, return lat/lons for the route path.
services.postRoutePath = function (inputs)
Takes coords objects and route options, return lat/lons for the route path.
services.postRoutePathRaw = function (inputs)
Same as services.postRoutePath function.
services.getDerivedRoutePath = function (params)
Take pings and route options, return derived route points.
services.postDerivedRoutePath = function (inputs)
Retrieve a list of reduce trip coordinates in GeoJson format based on a series of longitudes/latitude pings and off route mileages window.
services.postDerivedRouteReports = function (inputs)
The postDerivedRouteReports operation will return either mileage or detail report for the reduced trip based upon a series of latitude/longitudes pings.
services.getRoadSurfaceRoute = function (inputs)
Allows a user to request road surface conditions for each point of a route path.
services.addAvoidFavorSet = function (params)
Add a new avoid/favor set.
services.getAvoidFavorSets = function (params)
Retrieves all AvoidFavorSets, one specific set if the setId is specified.
services.updateAvoidFavorSet = function (params)
Update name and tag based on set Id.
services.deleteAvoidFavorSet = function (params)
Deletes the AvoidFavor set.
services.addAvoidFavor = function (params)
Add a new set with closure.
services.deleteAvoidFavor = function (params)
Deletes a specific AvoidFavors within a set.
services.poiRadiusSearch = function (params)
Gets points of interest within a specified radius of a given point.
services.weatherAlerts = function (params)
Get weather alerts.
services.weatherAlertsGeoJson = function (params)
Gets weather alerts in GeoJson.
services.countyPolygons = function (params)
Gets county polygons.
services.zipPolygons = function (params)
Gets zip polygons.
services.statePolygons = function (params)
Gets state polygons.
services.getDriveTimePolygon = function (params)
Get a polygon of drivable locations from the center point within a specified time constraint.
services.getTrafficIncidentsBox = function (params)
Retrieves traffic incidents within the given bounding box
services.getTrafficCamerasBox = function (params)
Retrieves traffic cameras within the given bounding box
services.getTrafficCameraMetadata = function (params)
Retrieves traffic camera metadata for the given camera id.
services.getAttribution = function (params)
Retrieves the necessary attribution for a given layer based on the layer’s type and its settings.
services.postRailRoutePath = function (params)
Takes stops objects and route options, return lat/lons in geo json.
services.getRailStations = function (params)
Takes SPLC code and returns first matched station if there is one.
services.getSitesBox = function (params)
Gets ALK sites
services.getAvoidFavorGroup = function (params)
Gets avoid/favor for a given set.
services.getAvoidFavorBox = function (params)
Gets avoid/favor for a given set within a given bounding box.
services.getTruckRestrictions = function (params)
Gets truck restrictions for a given bounding box.
Instances of this class represent bounding boxes.
This class represents a longitude and latitude pair
Close