ALKMaps.Layer.TrafficIncidents

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

Inherits from

  • <ALKMaps.Layer.VirtualTile>
Summary
ALKMaps.Layer.TrafficIncidentsA vector layer for displaying traffic incidents.
Properties
language{String} Desired incidents language.
cacheInterval{Number} Traffic incidents 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.
minZoomLevel{Number} Minimum zoom level for requesting traffic incidents.
wrapDateLine
Constructor
ALKMaps.Layer.TrafficIncidentsA class for traffic incidents layer.
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.
destroyFeaturesDestroys features, empties cluster strategy cache, and removes all relevant popups.
getTrafficIncidentsGets traffic incidents for the given bbox.
getIncidentImageGets the image most closely relating to the type of traffic incident.
onmouseoverWhen mouse hovers over a cluster, it will try to show the number of incidents in the cluster.
onmouseclickWhen mouse clicks on a cluster, it will try to display the first incident’s description in cluster.

Properties

language

{String} Desired incidents language.

cacheInterval

{Number} Traffic incidents returned from the service will be cached at least for this given period of minutes.  Default is 10 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.

minZoomLevel

{Number} Minimum zoom level for requesting traffic incidents.

wrapDateLine

Constructor

ALKMaps.Layer.TrafficIncidents

A class for traffic incidents layer.

Parameters

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

Valid options include

language{String} Desired incidents language.
distance{Number} Cluster strategy pixel distance.
threshold{Number} Cluster strategy minimum feature threshold.
onStartCallback{Function} Service start callback function.
onAddedCallback{Function} Service added callback function.
onErrorCallback{Function} Service error callback function.
minZoomLevel{Number} Minimum zoom level for retrieving traffic incidents.
cacheInterval{Number} Indicates how long in minutes will traffic incidents re-cached.
cluster{Boolean} Indicates whether or not the layer should be clustered.
strategies{ALKMaps.Strategy.Cluster} 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}

destroyFeatures

destroyFeatures: function()

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

getTrafficIncidents

getTrafficIncidents: function(options)

Gets traffic incidents for the given bbox.

Parameters

options{Object}

Valid options

bbox{ALKMaps.Bounds}

getIncidentImage

getIncidentImage: function(category)

Gets the image most closely relating to the type of traffic incident.

Parameters

category{String} Type of traffic event.

onmouseover

onmouseover: function(feature)

When mouse hovers over a cluster, it will try to show the number of incidents in the cluster.  When mouse hovers over a vector, it will try to show the event type.

Parameters

feature{ALKMaps.Feature.Vector} object

onmouseclick

onmouseclick: function(feature)

When mouse clicks on a cluster, it will try to display the first incident’s description in cluster.  When mouse clicks on a vector, it will try to display the vector’s description.

Parameters

feature{ALKMaps.Feature.Vector} object
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.
destroyFeatures: function()
Destroys features, empties cluster strategy cache, and removes all relevant popups.
getTrafficIncidents: function(options)
Gets traffic incidents for the given bbox.
getIncidentImage: function(category)
Gets the image most closely relating to the type of traffic incident.
onmouseover: function(feature)
When mouse hovers over a cluster, it will try to show the number of incidents in the cluster.
onmouseclick: function(feature)
When mouse clicks on a cluster, it will try to display the first incident’s description in cluster.
A class for traffic incidents layer.
Strategy for vector feature clustering.
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