Home Reference Source
public class | source

Aesthetic

Class that represents an aesthetic element. There will be one Aesthetic class for each class on the Legend.

Constructor Summary

Public Constructor
public

constructor(id: number, attr: string, fcolor: number[], stroke: number[], pointsize: number | null, range: number[])

Creates an instance of Aesthetic.

Member Summary

Public Members
public

This particular element will be active or not in the Legend.

public

fillColor: number[4]

The color to fill the Aesthetic element(RGBA).

public

The unique id of the Aesthetic object.

public

Outer of? This is used for what?

public

The size of the Aesthetic point to be drawn (Used only in maps that require dots to be drawn).

public

range: number[2]

The range for this particular Aesthetic element.

public

strokeColor: number[4]

Stroke color values(RGBA).

Private Members
private

This Array is used for?

private

The attribute being mapped on the Aesthetic.

private

This Array will keep track of all Features associated with this Aesthetic object.

Method Summary

Public Methods
public

addFeature(id: number, properties: {fx: string, _gisplayid: number}, triangles: {itemSize: number, numItems: number}, borders: {itemSize: number, numItems: number}, points: number[])

Adds a new feature to this Aesthetic object.

public

addGroupedFeature(id: number, triangles: null, borders: null, points: {buffer: WebGLBuffer, itemSize: number, numItems: number})

Add new grouped feature ?

public

Verifies the existence or not of the property Aesthethic._attr and if it fits inside this Aesthetic range.

public

Inverts this Aesthetic element state in the Legend object.

public

Gets this Aesthetic attribute.

Public Constructors

public constructor(id: number, attr: string, fcolor: number[], stroke: number[], pointsize: number | null, range: number[]) source

Creates an instance of Aesthetic. There will be as many Aesthetic objects as the number of classes on the Legend.

Params:

NameTypeAttributeDescription
id number

The unique id of the Aesthetic object.

attr string

The attribute being mapped on this Aesthetic.

fcolor number[]

The color to fill the Aesthetic element(RGBA).

stroke number[]

Stroke color values(RGBA).

pointsize number | null

Size of the Aesthetic point to be drawn (Used only in maps that require dots to be drawn).

range number[]

The range for this particular Aesthetic element.

Example:

1-> {"id":0,"attr":"f3","fcolor":[255,255,255,0.8],
        "stroke":[0,0,0,1],"pointsize":null,"range":[1,37]}
2-> {"id":1,"attr":"f3","fcolor":[255,255,0,0.8],
        "stroke":[0,0,0,1],"pointsize":null,"range":[37,78]}

Public Members

public enabled: boolean source

This particular element will be active or not in the Legend.

public fillColor: number[4] source

The color to fill the Aesthetic element(RGBA).

public id: number source

The unique id of the Aesthetic object.

public outer: boolean source

Outer of? This is used for what?

public pointSize: number | null source

The size of the Aesthetic point to be drawn (Used only in maps that require dots to be drawn).

public range: number[2] source

The range for this particular Aesthetic element.

public strokeColor: number[4] source

Stroke color values(RGBA).

Private Members

private _allFeatures: Array<Feature> source

This Array is used for?

private _attr: string source

The attribute being mapped on the Aesthetic.

private _features: Array<Feature> source

This Array will keep track of all Features associated with this Aesthetic object.

Public Methods

public addFeature(id: number, properties: {fx: string, _gisplayid: number}, triangles: {itemSize: number, numItems: number}, borders: {itemSize: number, numItems: number}, points: number[]) source

Adds a new feature to this Aesthetic object.

Params:

NameTypeAttributeDescription
id number

The Feature id. Each feature will have a different id inside this Aesthetic object.

properties {fx: string, _gisplayid: number}

Properties associated with the Feature.

triangles {itemSize: number, numItems: number}

Number of triangles associated with the Feature.

borders {itemSize: number, numItems: number}

Number of borders associated with the Feature.

points number[]

The points that belong to the Feature.

public addGroupedFeature(id: number, triangles: null, borders: null, points: {buffer: WebGLBuffer, itemSize: number, numItems: number}) source

Add new grouped feature ?

Params:

NameTypeAttributeDescription
id number
triangles null

Always empty? See line:479 Map.js

borders null

Always empty? See line:479 Map.js

points {buffer: WebGLBuffer, itemSize: number, numItems: number}

TODO:

  • Finish document of this method.

public checkProperty(value: string): boolean source

Verifies the existence or not of the property Aesthethic._attr and if it fits inside this Aesthetic range.

Params:

NameTypeAttributeDescription
value string

The attribute ?.

Return:

boolean

True if there's no range or it is inside the range or ?, otherwise, false.

public enableDisable(): boolean source

Inverts this Aesthetic element state in the Legend object. If it was enabled it will be disabled or vice-versa.

Return:

boolean

Inverse of current enabled value.

public getAttr(): _attr source

Gets this Aesthetic attribute.

Return:

_attr

The string representing the attr of this Aesthetic.