All docs
V19.1
24.2
The page you are viewing does not exist in version 24.2.
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

JavaScript/jQuery VectorMap - Layer Element.Methods

Methods used to control the vector map layer element.

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.