Class: ColormapLegend

ColormapLegend

Creates a visual legend for a colormap.


new ColormapLegend(viewer, colorscale [, options])

Creates a new ColormapLegend instance.

Parameters:
Name Type Argument Description
viewer Object

Viewer instance to attach legend to

colorscale Colormap

Colormap to create legend for

options Object <optional>

Configuration options

Properties
Name Type Argument Default Description
nticks number <optional>
6

Number of ticks/divisions in legend

legendWidth number <optional>
25

Width of legend as percentage

textColor string <optional>
'#fff'

Color of text labels

class string <optional>
'openlime-legend'

CSS class for legend container

Source: