Library globals

Function globals . canvas . MapStructure . Symbol . getStyle

View source

Wrapper method for accessing style. It allows to pass a default value
if the requested style is not defined.
It also automatically resolves style properties when they're defined as
functions, by calling the corresponding function using the 'me' context

EXAMPLE:

me.style = {
color: [1,1,1],
line_color: func(){
me.model.tuned ? [0,0,1] : [1,1,1]
}
}
var color = me.getStyle('color'); # --> [1,1,1]
me.model.tuned = 1;
var line_color = me.getStyle('line_color'); # --> [0,0,1]
var txt_color = me.getStyle('text_color', [1,1,1]); # --> [1,1,1]

Parameters

name

default
optional