Constructor
new Legend()
Custom Leaflet control which will display a legend for colour-coded values.
Options:id
Unique id for the controlposition
The location on the map (using leaflet's standard control positions). Default: bottomrightcollapse
True to show a button until clicked, then show the legendbox; false to just show the expanded legend box. Default: falselabel
The label to give to the list of legend colours, set to null for no label. Default: nulltitle
The title the button when collapse=true. Default: 'Show legend'items
array of items to be displayed in the legend. Each item is an object with the following properties:red
Red value for the RGB colour indicatorgreen
Green value for the RGB colour indicatorblue
Blue value for the RGB colour indicatorname
The text to be displayed
iconClass
The CSS class(es) for the button icon (if collapse=true). Default: 'fa fa-list'legendListClass
The CSS class(es) legend list container. Default: none