Class: TrafficIncidentsJSON

alk.format.TrafficIncidentsJSON

An instance of this class provides a format for reading and writing Traffic Incidents JSON. See alkx.TrafficIncidentSpec.

new alk.format.TrafficIncidentsJSON(opt_options)

This constructor creates a Format object with which to parse and deocde ALK Traffic Incident data.

Features with Point geometries are generated based on the data and are given FeatureIds ol.Feature#getId based on the string id of each object. With this id, the vector source will not add new features with the same id, thereby eliminating duplicates.

If the optional HashedIdFactory is not replaced, a FnVA32 hash algorithm creates the feature Id based on the entire stringified version of the JSON object for each POI. The chances for collision is 1:2^32.

If a strict adherence to uniqueness is absolutely needed, the idFactory may be replaced with the options.idFactory.

Option Type Description
idFactory alk.format.HashedIdFactory | undefined

This option allows the replacement of the default hashed id factory used by this format. The default is alk.format.HashedIdFactory without hash collision checking.

defaultDataProjection ol.ProjectionLike | undefined

Default data projection. Default is EPSG:4326.

featureProjection ol.ProjectionLike | undefined

Projection for features read or written by the format. Options passed to read or write methods will take precedence.

Extends