Skip to main content

TileLayer

Description

The tile layer is used with the standalone adapter to add raster tile basemaps to visualizations. See the Tile Layer docs for details.

TileLayer

Constructors

new TileLayer(def)

Creates a new instance of the layer.

Parameters

def

object

optional

The layer definition object.

data

string

optional

Initial data to load into this layer. Data can be changed after instantiation via layer.data().

id

string

optional

A unique identifier for this layer. If omitted one will be generated automatically.

options

Initial options to set on this layer. Options can be changed after instantiation via layer.options() or layer.resetOptions().

visible

boolean

optional

Initial visibilty of this layer. Visibilty can be changed after instantiation via layer.visible().

Properties

id

string

readonly

A unique id of the layer.

Methods

data(data)

Gets or sets the current data for this layer.

Parameters

data

string

optional

The layer data to be displayed.

Returns
string

A reference to the data object it was most recently passed.

options(options)

Gets or sets the layer options while preserving any previously set options.

Parameters

options

The layer options to be set.

Returns
object

An object containing all layer options and their current values.

resetOptions(options)

Sets the provided layer options while resetting any other previously set options to default values.

Parameters

options

The layer options to be set.

Returns
void

visible(state)

Gets or sets the layer visibility.

Parameters

state

boolean

optional

Whether the layer is visible.

Returns
boolean

TileLayerOptions

Properties

accessToken

string

optional

Access token required for any 3rd party assets (e.g. google maps 3D tiles or Cesium ION).

attribution

string

optional

The text attribution to be shown in the bottom right corner of the map.

type

"raster" | "3d"

optional

default value

null

The type of tiles to render. By default this will be inferred from your data.