Home Reference Source Test
public class | source

Legend

This class represents the Map Legend. 15/03

See:

Constructor Summary

Public Constructor
public

constructor(id: number, title: string)

Creates an instance of Legend class.

Member Summary

Public Members
public

Constant to use when it's a Point.

public

Constant to use when it's a Polygon.

public

Class name for the Legend? Not used?

public

If it is the first insertion or not.

public

lastdiv: HTMLDivElement

The last div to insert in the legend.

public

legendDiv: HTMLDivElement

The div that contains the Legend.

public

table: HTMLTableElement

The table element where the legend elements will be apppended.

public

Title of the Gisplay map Legend.

Method Summary

Public Methods
public

init(id: number, classname: string)

Initialise Legend.

public

insertGradient(mapobj: Map, left: number, middle: number, right: number)

this method was deprecated. Not used, since now Change Maps use classes instead of gradient.

Inserts in the Legend one gradient according to the Aesthetic object.

public

Appends the legend div element to the map container.

public

insertPointRow(currentaes: Aesthetic, mapobj: Map)

Inserts one row for the Aesthetic object.

public

insertPolygonRow(currentaes: Aesthetic, mapobj: Map)

Inserts one polygon row into the Legend.

public

insertProportionalSymbols(currentaes: Aesthetic, mapobj: Map, numLegendItems: number)

Inserts one Proportional symbols legend element.

public

insertRow(currentaes: Aesthetic, mapobj: Map, type: number)

Adds one row to the Legend and attaches an on click event to said row.

Public Constructors

public constructor(id: number, title: string) source

Creates an instance of Legend class.

Params:

NameTypeAttributeDescription
id number

The id of the legend.

title string

The title for the legend.

Public Members

public POINT: number source

Constant to use when it's a Point.

public POLYGON: number source

Constant to use when it's a Polygon.

public className: string source

Class name for the Legend? Not used?

public firstInsertion: boolean source

If it is the first insertion or not. Only for PSymbol Maps.

public lastdiv: HTMLDivElement source

The last div to insert in the legend. Only for PSymbol Maps.

public legendDiv: HTMLDivElement source

The div that contains the Legend.

public table: HTMLTableElement source

The table element where the legend elements will be apppended.

public title: string source

Title of the Gisplay map Legend.

Public Methods

public init(id: number, classname: string) source

Initialise Legend. Creates a table element and appends title, color element and value element.

Params:

NameTypeAttributeDescription
id number

The id of this Legend.

classname string

The class name to be usde by the Legend.

public insertGradient(mapobj: Map, left: number, middle: number, right: number) source

this method was deprecated. Not used, since now Change Maps use classes instead of gradient.

Inserts in the Legend one gradient according to the Aesthetic object. Use in Change Maps.

Params:

NameTypeAttributeDescription
mapobj Map

The map where to insert the gradient row.

left number

Left value of the Legend (minimum change).

middle number

Value at the center of the change(aka break point).

right number

Right value of the legend (maximum value).

See:

public insertLegend(bgMap: BGMapWrapper) source

Appends the legend div element to the map container. Used by all Maps.

Params:

NameTypeAttributeDescription
bgMap BGMapWrapper

The background map where the legend will be appended to.

public insertPointRow(currentaes: Aesthetic, mapobj: Map) source

Inserts one row for the Aesthetic object. Used in Dot Maps.

Params:

NameTypeAttributeDescription
currentaes Aesthetic

The Aesthetic object

mapobj Map

The Map object where the point row will be added.

See:

public insertPolygonRow(currentaes: Aesthetic, mapobj: Map) source

Inserts one polygon row into the Legend. Used for area based Maps (Choropleth and Chorocromatic).

Params:

NameTypeAttributeDescription
currentaes Aesthetic

The Aesthetic object

mapobj Map

The map where to insert a polygon row.

See:

public insertProportionalSymbols(currentaes: Aesthetic, mapobj: Map, numLegendItems: number) source

Inserts one Proportional symbols legend element. Used by PSymbols Maps.

Params:

NameTypeAttributeDescription
currentaes Aesthetic

The Aesthetic object.

mapobj Map

The map where to insert the proportion symbols element.

numLegendItems number

Number of items to be created.

See:

public insertRow(currentaes: Aesthetic, mapobj: Map, type: number) source

Adds one row to the Legend and attaches an on click event to said row.

Params:

NameTypeAttributeDescription
currentaes Aesthetic

The Aesthetic object.

mapobj Map

The map where to insert a polygon row.

type number

The type of row to insert. 1=Polygon, 2=Point. @TODO: Should be constant