Methods
-
staticSuperMap3D.ColorTable.clone(colorTable, result) → ColorTable
-
Duplicate the colormap object.
Name Type Description colorTableColorTable The colormap object to copy. resultColorTable 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); -
Remove the colormap.
Example:
var colorTable = new SuperMap3D.ColorTable(); colorTable.clear(); -
Get the number of colormap objects.
Returns:
The number of colormaps.Example:
var colorTable = new SuperMap3D.ColorTable(); var count = colorTable.count(); -
Get the colormap object at the specified index.
Name Type Description indexNumber 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 new entries into the color table.
Name Type Description valueNumber height value. colorColor 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 the specified height item from the color table.
Name Type Description valueNumber Specify a height value. Returns:
Returns true if removal is successful, false otherwise.Example:
var colorTable = new SuperMap3D.ColorTable(); colorTable.remove(30);
