DataSourceOptions interface

A data source for managing shape data that will be displayed on the map. A data source must be added to a layer before it is visible on the map. Options for a DataSourceOptions.

Extends

Properties

buffer

The size of the buffer around each tile. A buffer value of 0 will provide better performance but will be more likely to generate artifacts when rendering. Larger buffers will produce left artifacts but will result in slower performance. default 128

cluster

A boolean indicating if Point features in the source should be clustered or not. If set to true, points will be clustered together into groups by radius. default false

clusterMaxZoom

The maximum zoom level in which to cluster points. Defaults to one zoom less than maxZoom so that last zoom features are not clustered.

clusterMinPoints

Minimum number of points necessary to form a cluster if clustering is enabled.

clusterProperties

Defines custom properties that are calculated using expressions against all the points within each cluster and added to the properties of each cluster point.

clusterRadius

The radius of each cluster in pixels. default 50

filter

An expression for filtering features prior to processing them for rendering.

generateId

Whether to generate ids for the geojson features. When enabled, the feature.id property will be auto assigned based on its index in the features array, over-writing any previous values.

lineMetrics

Specifies whether to calculate line distance metrics. This is required for line layers that specify lineGradient values. default false

maxZoom

Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels). default 18

promoteId

A property to use as a feature id (for feature state). Either a property name, or an object of the form {: }.

tolerance

The Douglas-Peucker simplification tolerance that is applied to the data when rendering (higher means simpler geometries and faster performance). default 0.375

Property Details

buffer

The size of the buffer around each tile. A buffer value of 0 will provide better performance but will be more likely to generate artifacts when rendering. Larger buffers will produce left artifacts but will result in slower performance. default 128

buffer?: number

Property Value

number

cluster

A boolean indicating if Point features in the source should be clustered or not. If set to true, points will be clustered together into groups by radius. default false

cluster?: boolean

Property Value

boolean

clusterMaxZoom

The maximum zoom level in which to cluster points. Defaults to one zoom less than maxZoom so that last zoom features are not clustered.

clusterMaxZoom?: number

Property Value

number

clusterMinPoints

Minimum number of points necessary to form a cluster if clustering is enabled.

clusterMinPoints?: number | undefined

Property Value

number | undefined

clusterProperties

Defines custom properties that are calculated using expressions against all the points within each cluster and added to the properties of each cluster point.

clusterProperties?: Record<string, AggregateExpression>

Property Value

Record<string, AggregateExpression>

clusterRadius

The radius of each cluster in pixels. default 50

clusterRadius?: number

Property Value

number

filter

An expression for filtering features prior to processing them for rendering.

filter?: any

Property Value

any

generateId

Whether to generate ids for the geojson features. When enabled, the feature.id property will be auto assigned based on its index in the features array, over-writing any previous values.

generateId?: boolean | undefined

Property Value

boolean | undefined

lineMetrics

Specifies whether to calculate line distance metrics. This is required for line layers that specify lineGradient values. default false

lineMetrics?: boolean

Property Value

boolean

maxZoom

Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels). default 18

maxZoom?: number

Property Value

number

promoteId

A property to use as a feature id (for feature state). Either a property name, or an object of the form {: }.

promoteId?: [key: string]: string | string | undefined

Property Value

[key: string]: string | string | undefined

tolerance

The Douglas-Peucker simplification tolerance that is applied to the data when rendering (higher means simpler geometries and faster performance). default 0.375

tolerance?: number

Property Value

number