Class: Carousel

Carousel

A carousel object to allow changing individual client renderered tiles.
Instantiate a Carousel object to allow tile-by-tile control for all layers in the carousel 'bundle'. This object modifies the functionality from its bundled layer objects as follows:
    1) Opacity is shared across all bundled layers.
    2) Z-Index is shared across all bundled layers.
    3) Theme is shared across all bundled layers.
    4) Enabling / disabling a layer will switch all tiles to that particular layer.

Extends

Methods

addLayer(layer)

Adds a client rendered layer to the carousel object. This involves 'patching' the methods of the layer with those from the carousel to give the required functionality.
Name Type Description
layer Layer The client rendered layer object.

decrementTileLayerIndex(tilekey)

Decrement which layer index the current tile points to. This will redraw the modified tile.
Name Type Description
tilekey String The tile key string.

inherited getChannel(){String}

Returns the publish/subscribe channel id of this specific layer.
Returns:
publish/subscribe channel for the layer.

getLayerIndexForTile(tilekey){number}

Returns the layer index for a particular tile.
Name Type Description
tilekey String The tile key string.
Returns:
layer index for the tile.

inherited getOpacity(){float}

Returns the opacity of the layer.
Returns:
opacity of the layer.

getRendererForTile(tilekey){number}

Returns the renderer for a particular tile.
Name Type Description
tilekey String The tile key string.
Returns:
renderer for the tile.

inherited getUUID(){String}

Returns the UUID that uniquely identifies this layer.
Returns:
UUID of the layer.

incrementTileLayerIndex(tilekey)

Increment which layer index the current tile points to. This will redraw the modified tile.
Name Type Description
tilekey String The tile key string.

inherited isEnabled(){boolean}

Get whether or not the layer is enabled.
Returns:
the layer is visible or not.

removeLayer(layer)

Remove a layer from the carousel. This will 'unpatch' the layers and return them to their original state.
Name Type Description
layer Layer The layer object.

inherited setEnabled(enabled)

Set whether or not the layer is enabled.
Name Type Description
enabled boolean whether the layer is visible or not

inherited setOpacity(opacity)

Set the opacity of the layer.
Name Type Description
opacity float opacity value from 0 to 1.

setTileLayerIndex(tilekey, index)

Set which layer index the current tile points to. This will redraw the modified tile.
Name Type Description
tilekey String The tile key string.
index number The new layer index for the tile.

setTileLayerIndices(index)

Set the layer index for all tiles. This will redraw the entire layer.
Name Type Description
index String The layer index for all tiles.