new alk.source.TrafficCamerasSource(opt_options)
This constructor creates a Source object that collects traffic cameras from the supplied or created
alk.service.TrafficCamerasService
.
Option | Type | Description |
---|---|---|
trafficCamerasService |
alk.service.TrafficCamerasService | undefined |
This option supplies the TrafficCamerasService to use within this source. This option is mutually exclusive with the trafficCamerasServiceOptions options. |
trafficCamerasServiceOptions |
alkx.TrafficCamerasServiceOptions | undefined |
This option supplies the properties with which to create this source's
internal |
attributions |
ol.AttributionLike | undefined |
This option is an OpenLayers option passed to the Attributions. |
cacheSize |
number | undefined |
This option is an OpenLayers option passed to the Cache size. Default is 2048. |
extent |
ol.Extent | undefined |
This option is an OpenLayers option passed to the It contains the map extent in which the source is relevant. |
crossOrigin |
null | string | undefined |
This option is an OpenLayers option passed to the The crossOrigin attribute for loaded images. Note that you must provide a
|
opaque |
boolean | undefined |
This option is an OpenLayers option passed to the Whether the layer is opaque. |
maxZoom |
number | undefined |
This option is an OpenLayers option passed to the Optional maximum zoom level. Default is 20 (ALK specific). |
reprojectionErrorThreshold |
number | undefined |
This option is an OpenLayers option passed to the Maximum allowed reprojection error (in pixels). Default is 0.5. Higher values may increase reprojection performance, but decrease precision. |
wrapX |
boolean | undefined |
This option is an OpenLayers option passed to the Whether to wrap the world horizontally. The default, |
Extends
- ol.source.Vector
Methods
-
changeTrafficCamerasService(options)
-
This method causes an entire refresh of this source. It does this by creating a new TrafficCamerasService from the old one with the extended options.
Option Type Description apiKey
string This option contains the ALK ApiKey that gives you permission to extract data from ALK Servers.
dataset
alk.val.Dataset | number | string The option contains the Dataset parameter for the Service. This option specifies an area dataset that may be pertinent to the request.
region
alk.val.Region | number | string This option tells the service in which region the retrieved data is to pertain. Some ALK Services switch underlying services due to this option. For instance, traffic data for North America and Europe may come from different underlying services.
srs
alk.val.SRS | number | string This option tells the service the particular projection that is used any GIS data given to the service.
hostURL
string This option contains the the host and port URL for the particular service. This option is not set by the user, but is automatically generated from the particular service being used.
path
string This option is the path part of the URL for the particular service. This option is not set by the user, but is automatically generated from the particular service being used.
boundingBox
Array.<number> | string This option holds the bounding box, or extent in which the items are requested.
-
getTrafficCameras(){Array.<alkx.TrafficCameraSpec>}
-
This function returns the current state of traffic cameras received by this source. This function just returns the associated traffic camera with each feature currently residing in this source.
NOTE
This returns the immediate current state of the source. If the source is in the process of updating, which could be from user interaction, such as a zoom in or out, the result may not be stable.
One may wait until the source's state, i.e.
getState
, is in the ol.source.State.READY state, as opposed to ol.source.State.LOADING. However, that condition is not really guaranteed at any given point in time, unless other precautions are taken.If one desires a more stable result, use the
alk.service.TrafficCamerasService#get
call with a specific pt1 and pt2 parameters defining the desired extent. -
getTrafficCamerasService(){alk.service.TrafficCamerasService}
-
-
removeAllFeatures(features)
-
This method removes all features from this source.
Name Type Description features
Array.<ol.Feature> -
setTrafficCamerasService(service)
-
Name Type Description service
alk.service.TrafficCamerasService