ColorTable

new SuperMap3D.ColorTable()

Colormap class.

Methods

staticSuperMap3D.ColorTable.clone(colorTable, result)ColorTable

Duplicate the colormap object.
Name Type Description
colorTable ColorTable The colormap object to copy.
result ColorTable optional The object to store the result, if undefined a new instance will be created.
Returns:
The modified result parameter, or a new instance if not provided. If the colormap is undefined, return undefined.
Example:
var colorTable = new SuperMap3D.ColorTable();
colorTable.insert(900, new SuperMap3D.Color(1, 0, 0));
colorTable.insert(600, new SuperMap3D.Color(0, 0, 1));
var cloneTable = SuperMap3D.ColorTable.clone(colorTable);

clear()

Remove the colormap.
Example:
var colorTable = new SuperMap3D.ColorTable();
colorTable.clear();

count()Number

Get the number of colormap objects.
Returns:
The number of colormaps.
Example:
var colorTable = new SuperMap3D.ColorTable();
var count = colorTable.count();

getItem(index)Object

Get the colormap object at the specified index.
Name Type Description
index Number The specified index value.
Returns:
Object color table: Key is the elevation value, and Value is the object color.
Example:
var colorTable = new SuperMap3D.ColorTable();
var value = colorTable.getItem(1)

insert(value, color)

Insert new entries into the color table.
Name Type Description
value Number height value.
color Color optional color information.
Example:
var colorTable = new SuperMap3D.ColorTable();
colorTable.insert(900, new SuperMap3D.Color(1, 0, 0));
colorTable.insert(600, new SuperMap3D.Color(0, 0, 1));

remove(value)Boolean

Remove the specified height item from the color table.
Name Type Description
value Number Specify a height value.
Returns:
Returns true if removal is successful, false otherwise.
Example:
var colorTable = new SuperMap3D.ColorTable();
colorTable.remove(30);