Home Reference Source Repository
public class | source

LayerLegend

a wrapper to make a legend

Constructor Summary

Public Constructor
public

constructor(legendItems: Array, divId: string, options: object)

Member Summary

Public Members
public
public
public
public set

showAll: *

Public Constructors

public constructor(legendItems: Array, divId: string, options: object) source

Params:

NameTypeAttributeDescription
legendItems Array

array of layers or objects with {groupName: {string}, collapse: {boolean}, addCheck: {boolean}, items: {Array}}

divId string

the div where the legend should be added

options object

for legend

options.layerDivClasses Array
  • optional
  • default: []

optional array of classes to be applied to the layer legend divs for custom styling

options.legendTitle string
  • optional
  • default: Legend

the legend title

options.scaleDependent bool
  • optional
  • default: true

if legend display is scale dependent

Public Members

public $divElement: * source

public layerGroup: * source

public legendId: * source

public set showAll: * source