Builder

class Builder(sourceId: String)

Builder for VectorSource.

Parameters

sourceId

the ID of the source

Constructors

Builder
Link copied to clipboard
fun Builder(sourceId: String)

Functions

attribution
Link copied to clipboard
fun attribution(value: String): VectorSource.Builder

Contains an attribution to be displayed when the map is shown to a user.

bounds
Link copied to clipboard
fun bounds(value: List<Double> = listOf(-180.0, -85.051129, 180.0, 85.051129)): VectorSource.Builder

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.

build
Link copied to clipboard
fun build(): VectorSource

Build the VectorSource.

maxOverscaleFactorForParentTiles
Link copied to clipboard
fun maxOverscaleFactorForParentTiles(value: Long): VectorSource.Builder

When a set of tiles for a current zoom level is being rendered and some of the ideal tiles that cover the screen are not yet loaded, parent tile could be used instead. This might introduce unwanted rendering side-effects, especially for raster tiles that are overscaled multiple times. This property sets the maximum limit for how much a parent tile can be overscaled.

maxzoom
Link copied to clipboard
fun maxzoom(value: Long = 22L): VectorSource.Builder

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

minimumTileUpdateInterval
Link copied to clipboard
fun minimumTileUpdateInterval(value: Double = 0.0): VectorSource.Builder

Minimum tile update interval in seconds, which is used to throttle the tile update network requests. If the given source supports loading tiles from a server, sets the minimum tile update interval. Update network requests that are more frequent than the minimum tile update interval are suppressed.

minzoom
Link copied to clipboard
fun minzoom(value: Long = 0L): VectorSource.Builder

Minimum zoom level for which tiles are available, as in the TileJSON spec.

prefetchZoomDelta
Link copied to clipboard
fun prefetchZoomDelta(value: Long = 4L): VectorSource.Builder

When loading a map, if PrefetchZoomDelta is set to any number greater than 0, the map will first request a tile at zoom level lower than zoom - delta, but so that the zoom level is multiple of delta, in an attempt to display a full map at lower resolution as quick as possible. It will get clamped at the tile source minimum zoom. The default delta is 4.

promoteId
Link copied to clipboard
fun promoteId(value: PromoteId): VectorSource.Builder

A property to use as a feature id (for feature state). Either a property name, or an object of the form {<sourceLayer>: <propertyName>}. If specified as a string for a vector tile source, the same property is used across all its source layers.

scheme
Link copied to clipboard
fun scheme(value: Scheme = Scheme.XYZ): VectorSource.Builder

Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.

tileNetworkRequestsDelay
Link copied to clipboard
fun tileNetworkRequestsDelay(value: Double = 0.0): VectorSource.Builder

For the tiled sources, this property sets the tile network requests delay. The given delay comes in action only during an ongoing animation or gestures. It helps to avoid loading the transient tiles from the network and thus to avoid redundant network requests. Note that tile-network-requests-delay value is superseded with tile-requests-delay property value, if both are provided.

tileRequestsDelay
Link copied to clipboard
fun tileRequestsDelay(value: Double = 0.0): VectorSource.Builder

For the tiled sources, this property sets the tile requests delay. The given delay comes in action only during an ongoing animation or gestures. It helps to avoid loading, parsing and rendering of the transient tiles and thus to improve the rendering performance, especially on low-end devices.

tiles
Link copied to clipboard
fun tiles(value: List<String>): VectorSource.Builder

An array of one or more tile source URLs, as in the TileJSON spec.

tileSet
Link copied to clipboard
fun tileSet(tileSet: TileSet): VectorSource.Builder

Add a TileSet to the Source.

fun tileSet(tilejson: String, tiles: List<String>, block: TileSet.Builder.() -> Unit): VectorSource.Builder

Add a TileSet to the Source, using DSL.

url
Link copied to clipboard
fun url(value: String): VectorSource.Builder

A URL to a TileJSON resource. Supported protocols are http:, https:, and mapbox://<Tileset ID>.

volatile
Link copied to clipboard
fun volatile(value: Boolean = false): VectorSource.Builder

A setting to determine whether a source's tiles are cached locally.

Properties

sourceId
Link copied to clipboard
val sourceId: String