ALKMaps.Layer.Traffic (Leaflet)

The ALKMaps traffic layer.

Inherits from

  • <L.TileLayer>
var traffic = L.ALKMaps.Layer.traffic({
    region: "NA",
    opacity: 0.75
});
Summary
ALKMaps.Layer.Traffic (Leaflet)The ALKMaps traffic layer.
Properties
projection{String} Map projection code.
region{String} map data region code
histDay{String} Day of the week for historical traffic data spelled out in English.
histTimeBin{integer} Time “bin” for the historical traffic data.
histTimeZone{String} Time zone offset, see ISO 8601 for more details.
Constructor
L.ALKMaps.Layer.TrafficInitializes a new Traffic layer object
Functions
setRegionsets/changes region of the map
cloneCreate a clone of this layer

Properties

projection

{String} Map projection code.  Default is “EPSG:900913”.

// Get map projection for this layer.
var projection = tileLayer.projection;
// Set map projection for this layer. Or projection can be passed in as options parameter when the layer instance is created.
tileLayer.projection = L.CRS.EPSG900913.code;

region

{String} map data region code

histDay

{String} Day of the week for historical traffic data spelled out in English.  Case doesn’t matter, but it can’t be abbreviated.  Example: “Friday”.  If this or histTimeBin are null you will get real-time traffic.

histTimeBin

{integer} Time “bin” for the historical traffic data.  Each “bin” is a 15 minute increment, starting at midnight as bin 0.  That means there are 96 bins in total (0-95).  12:00am = 0, 12:15am = 1 ...  8:00am = 32 ...  5:00pm = 68 ...  11:45pm = 95... etc.  If this or histDay are blank you will get real-time traffic.

histTimeZone

{String} Time zone offset, see ISO 8601 for more details.  The colon between hr and min is required.  Example: “-04:00”

Constructor

L.ALKMaps.Layer.Traffic

Initializes a new Traffic layer object

Parameters

options{Object} Traffic Layer Options

Functions

setRegion

setRegion: function(regionCode)

sets/changes region of the map

Parameters

regionCode{String} the code for the map region (“NA”, “AS”, “EU”, ...)

clone

clone: function()

Create a clone of this layer

Returns

{L.ALKMaps.Layer.Traffic} The cloned layer.

setRegion: function(regionCode)
sets/changes region of the map
clone: function()
Create a clone of this layer
Close