Methods

This section describes the methods that can be used in code to manipulate the Layer Element object.

applySettings(settings)

Applies the layer element settings and updates element appearance.

Parameters:
settings:

Object

A configuration object for the element.

The settings object should contain one or more options to be changed for the layer element. The options available to change using this method are listed in the layers option description.

Note that you cannot change the dataSource option for a separate layer element.

attribute(name)

Gets the value of an attribute.

Parameters:
name:

String

The name of an attribute.

Return Value: any

The value of the required attribute.

The map marker data source can contain an object of attributes assigned to the attributes field. These attributes can hold any information you require. To obtain the value of an attribute, call the attribute(name) method with the name of the required attribute passed as the parameter.

attribute(name, value)

Sets the value of an attribute.

Parameters:
name:

String

The name of an attribute.

value: any

The new attribute value.

coordinates()

Gets the layer element coordinates.

Return Value:

Object

The element coordinates.

selected()

Gets the selection state of the layer element.

Return Value:

Boolean

Is true when the element is selected, otherwise, false.

selected(state)

Sets the selection state of the layer element.

Parameters:
state:

Boolean

Pass true to select the element and false to deselect it.