ALKMaps.Layer.TrafficCameras

A vector layer for displaying traffic cameras.  Create a new instance with the ALKMaps.Layer.TrafficCameras constructor.

Inherits from

  • <ALKMaps.Layer.VirtualTile>
Summary
ALKMaps.Layer.TrafficCamerasA vector layer for displaying traffic cameras.
Properties
cacheInterval{Number} Traffic cameras returned from the service will be cached at least for this given period of minutes.
threshold{Number} The threshold requirement for a cluster to be created.
distance{Number} The minimum distance in pixels for an incident to be included in a cluster.
cluster{Boolean} Determines whether or not the layer should be clustered.
wrapDateLine
Constructor
ALKMaps.Layer.TrafficCamerasConstruct a layer for traffic cameras.
Functions
setMapForces this layer having the same projection as the map.
moveToReset the vector layer’s div so that it once again is lined up with the map.
getCamerasGets traffic cameras for the given bbox.
getCameraMetadataGets camera’s metadata.
getUrlGets traffic camera image URL.
destroyFeaturesDestroys features, empties cluster strategy cache, and removes all relevant popups.
onmouseoverWhen mouse hovers over a cluster, try to get metadata for the first 4 cameras if a camera’s metadata does not exist.
onclickWhen a cluster is clicked, it will try to zoom to the extent of all features in the cluster.

Properties

cacheInterval

{Number} Traffic cameras returned from the service will be cached at least for this given period of minutes.  New traffic cameras will be requested when user pans or zooms the map.  Default is 8 hours.

threshold

{Number} The threshold requirement for a cluster to be created.

distance

{Number} The minimum distance in pixels for an incident to be included in a cluster.

cluster

{Boolean} Determines whether or not the layer should be clustered.

wrapDateLine

Constructor

ALKMaps.Layer.TrafficCameras

Construct a layer for traffic cameras.

Parameters

name{String} Used to identify this layer.
options{Object} Optional object whose properties will be set on the instance.

Valid options

cacheInterval{Number} The time duration in minutes that traffic cameras should be cached.
threshold{Number} Cluster strategy minimum feature threshold
distance{Number} Cluster strategy pixel distance
cluster{Boolean} Indicates whether or not the layer should be clustered.
strategies{Array(ALKMaps.Strategy)} Layer clustering strategies
styleMap{ALKMaps.StyleMap} Layer style map

Functions

setMap

setMap: function(map)

Forces this layer having the same projection as the map.

Parameters

map{ALKMaps.Map}

moveTo

moveTo: function(bounds,
zoomChanged,
dragging)

Reset the vector layer’s div so that it once again is lined up with the map.  Notify the renderer of the change of extent, and in the case of a change of zoom level (resolution), have the renderer redraw features.

If the layer has not yet been drawn, cycle through the layer’s features and draw each one.

Parameters

bounds{ALKMaps.Bounds}
zoomChanged{Boolean}
dragging{Boolean}

getCameras

getCameras: function(options)

Gets traffic cameras for the given bbox.  If the bbox does not present, uses the class level bbox setting.  If the bbox does not exist, gets all cameras.

Parameters

options{Object}

Valid options

bbox{ALKMaps.Bounds}

getCameraMetadata

getCameraMetadata: function(options)

Gets camera’s metadata.

Parameters

options{Object}

Valid options

id{String} camera id.
success{Function} callback function
failure{Function} callback function

getUrl

getUrl: function(options)

Gets traffic camera image URL.

Parameters

options{Object}

Valid options

id{String} camera id.
res{Number} image resolution.  0: HalfJpeg; 1: FullJpeg ; 2: HugeJpeg;

destroyFeatures

destroyFeatures: function()

Destroys features, empties cluster strategy cache, and removes all relevant popups.

onmouseover

onmouseover: function(feature)

When mouse hovers over a cluster, try to get metadata for the first 4 cameras if a camera’s metadata does not exist.  When mouse hovers over a camera, shows short camera information in the tooltip.

Parameters

feature{ALKMaps.Feature.Vector}

onclick

onclick: function(feature)

When a cluster is clicked, it will try to zoom to the extent of all features in the cluster.  When a single camera is clicked, a popup will be shown.  If user wants to show multiple traffic camera images or automatically updating camera images, user can’t use this method.  That is reason this method is not tied to any registered events by default.

Parameters

feature{ALKMaps.Feature.Vector}
setMap: function(map)
Forces this layer having the same projection as the map.
moveTo: function(bounds,
zoomChanged,
dragging)
Reset the vector layer’s div so that it once again is lined up with the map.
getCameras: function(options)
Gets traffic cameras for the given bbox.
getCameraMetadata: function(options)
Gets camera’s metadata.
getUrl: function(options)
Gets traffic camera image URL.
destroyFeatures: function()
Destroys features, empties cluster strategy cache, and removes all relevant popups.
onmouseover: function(feature)
When mouse hovers over a cluster, try to get metadata for the first 4 cameras if a camera’s metadata does not exist.
onclick: function(feature)
When a cluster is clicked, it will try to zoom to the extent of all features in the cluster.
Construct a layer for traffic cameras.
Abstract vector layer strategy class.
Instances of ALKMaps.Map are interactive maps embedded in a web page.
Instances of this class represent bounding boxes.
Vector features use the ALKMaps.Geometry classes as geometry description.
Close