A vector layer for displaying traffic incidents. Create a new instance with the ALKMaps.Layer.TrafficIncidents constructor.
ALKMaps. | A 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. | A class for traffic incidents layer. |
Functions | |
setMap | Forces this layer having the same projection as the map. |
moveTo | Reset the vector layer’s div so that it once again is lined up with the map. |
destroyFeatures | Destroys features, empties cluster strategy cache, and removes all relevant popups. |
getTrafficIncidents | Gets traffic incidents for the given bbox. |
getIncidentImage | Gets the image most closely relating to the type of traffic incident. |
onmouseover | When mouse hovers over a cluster, it will try to show the number of incidents in the cluster. |
onmouseclick | When mouse clicks on a cluster, it will try to display the first incident’s description in cluster. |
A class for traffic incidents layer.
name | {String} Used to identify this layer. |
options | {Object} Optional object whose properties will be set on the instance. |
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. |
setMap: function( map )
Forces this layer having the same projection as the map.
map | {ALKMaps.Map} |
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.
bounds | {ALKMaps.Bounds} |
zoomChanged | {Boolean} |
dragging | {Boolean} |
getTrafficIncidents: function( options )
Gets traffic incidents for the given bbox.
options | {Object} |
bbox | {ALKMaps.Bounds} |
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.
feature | {ALKMaps.Feature.Vector} object |
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.
feature | {ALKMaps.Feature.Vector} object |
Forces this layer having the same projection as the map.
setMap: function( map )
Reset the vector layer’s div so that it once again is lined up with the map.
moveTo: function( bounds, zoomChanged, dragging )
Destroys features, empties cluster strategy cache, and removes all relevant popups.
destroyFeatures: function()
Gets traffic incidents for the given bbox.
getTrafficIncidents: function( options )
Gets the image most closely relating to the type of traffic incident.
getIncidentImage: function( category )
When mouse hovers over a cluster, it will try to show the number of incidents in the cluster.
onmouseover: function( feature )
When mouse clicks on a cluster, it will try to display the first incident’s description in cluster.
onmouseclick: function( feature )