Class: AnnotationLayer

AnnotationLayer

A client rendered layer object. Uses JSON data retrieved from the server in conjunction with a Renderer object or html function to create interactable DOM elements. AnnotationLayers differ from ClientLayers in that the data they represent is mutable.

new AnnotationLayer(spec)

Instantiate an AnnotationLayer object.
Name Type Description
spec Object The specification object.
{
    opacity  {float}    - The opacity of the layer. Default = 1.0
    enabled  {boolean}  - Whether the layer is visible or not. Default = true
    zIndex   {integer}  - The z index of the layer. Default = 1000
    renderer {Renderer} - The tile renderer object.
}

Extends

Methods

inherited getChannel(){String}

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

inherited getOpacity(){float}

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

getTheme(){String}

Get the current theme for the layer.
Returns:
theme identifier string.

inherited getUUID(){String}

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

getZIndex(){integer}

Get the layers zIndex.
Returns:
zIndex for the layer.

inherited isEnabled(){boolean}

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

modify(annotation, callback)

Modify an existing annotation in the layer.
Name Type Description
annotation Object The target annotation.
callback function The callback function executing on success.

remove(certificate, callback)

Remove an existing annotation from the layer.
Name Type Description
certificate Object The target annotation certificate.
callback function The callback function executing on success.

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.

setRenderer(renderer)

Sets the current renderer of the layer.
Name Type Description
renderer Renderer The renderer to attach to the layer.
Updates the theme associated with the layer.
Name Type Description
theme String The theme identifier string.

setZIndex(zIndex)

Set the z index of the layer.
Name Type Description
zIndex integer The new z-order value of the layer, where 0 is front.

write(annotation, callback)

Write the a new annotation to the layer.
Name Type Description
annotation Object The target annotation.
callback function The callback function executing on success.