A vector layer for displaying traffic cameras. Create a new instance with the ALKMaps.Layer.TrafficCameras constructor.
ALKMaps. | A 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. | Construct a layer for traffic cameras. |
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. |
getCameras | Gets traffic cameras for the given bbox. |
getCameraMetadata | Gets camera’s metadata. |
getUrl | Gets traffic camera image URL. |
destroyFeatures | Destroys features, empties cluster strategy cache, and removes all relevant popups. |
onmouseover | When mouse hovers over a cluster, try to get metadata for the first 4 cameras if a camera’s metadata does not exist. |
onclick | 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.
name | {String} Used to identify this layer. |
options | {Object} Optional object whose properties will be set on the instance. |
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 |
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} |
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.
options | {Object} |
bbox | {ALKMaps.Bounds} |
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.
feature | {ALKMaps.Feature.Vector} |
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.
feature | {ALKMaps.Feature.Vector} |
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 )
Gets traffic cameras for the given bbox.
getCameras: function( options )
Gets camera’s metadata.
getCameraMetadata: function( options )
Gets traffic camera image URL.
getUrl: function( options )
Destroys features, empties cluster strategy cache, and removes all relevant popups.
destroyFeatures: function()
When mouse hovers over a cluster, try to get metadata for the first 4 cameras if a camera’s metadata does not exist.
onmouseover: function( feature )
When a cluster is clicked, it will try to zoom to the extent of all features in the cluster.
onclick: function( feature )