Documentation ¶
Overview ¶
Package mss implements a CartoCSS parser and rule generator.
Index ¶
- Variables
- type CompOp
- type Decoder
- type Field
- type Filter
- type MSS
- type ParseError
- type Prefix
- type Properties
- func (p *Properties) GetBool(property string) (bool, bool)
- func (p *Properties) GetColor(property string) (color.Color, bool)
- func (p *Properties) GetFieldList(property string) ([]interface{}, bool)
- func (p *Properties) GetFloat(property string) (float64, bool)
- func (p *Properties) GetFloatList(property string) ([]float64, bool)
- func (p *Properties) GetStopList(property string) ([]Stop, bool)
- func (p *Properties) GetString(property string) (string, bool)
- func (p *Properties) GetStringList(property string) ([]string, bool)
- func (p *Properties) SetDefaultInstance(instance string)
- func (p *Properties) String() string
- type Rule
- type Selector
- type Stop
- type Value
- type ZoomRange
Constants ¶
This section is empty.
Variables ¶
var AllZoom = ZoomRange(math.MaxInt32)
var InvalidZoom = ZoomRange(0)
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes one or more MSS files. Parse/ParseFile can be called multiple times to decode dependent .mss files. MSS() returns the current decoded style.
func (*Decoder) Evaluate ¶
Evaluate evaluates all expressions and resolves all references to variables. Must be called after last ParseFile/ParseString call.
func (*Decoder) ParseFile ¶
ParseFile parses the given .mss file. Can be called multiple times to parse a style split into multiple files.
func (*Decoder) ParseString ¶
func (*Decoder) Vars ¶
func (d *Decoder) Vars() *Properties
Vars returns the current set of all variables. Call Evaluate first to resolve expressions, functions and variables.
type MSS ¶
type MSS struct {
// contains filtered or unexported fields
}
func (*MSS) LayerRules ¶
LayerRules returns all Rules for this layer.
func (*MSS) LayerZoomRules ¶
LayerZoomRules returns all Rules for this layer within the specified ZoomRange.
type ParseError ¶
func (*ParseError) Error ¶
func (p *ParseError) Error() string
type Prefix ¶
func SortedPrefixes ¶
func SortedPrefixes(p *Properties, prefixes []string) []Prefix
SortedPrefixes returns a slice of all propertry prefixes, sorted by their first occurence.
type Properties ¶
type Properties struct {
// contains filtered or unexported fields
}
Properties is a map of all defined attributes for a rule. Use prop.GetXxx() to get typed properties.
func NewProperties ¶
func NewProperties(kv ...interface{}) *Properties
func NewPropertiesInstance ¶
func NewPropertiesInstance(kiv ...interface{}) *Properties
func (*Properties) GetFieldList ¶
func (p *Properties) GetFieldList(property string) ([]interface{}, bool)
func (*Properties) GetFloatList ¶
func (p *Properties) GetFloatList(property string) ([]float64, bool)
func (*Properties) GetStopList ¶
func (p *Properties) GetStopList(property string) ([]Stop, bool)
GetStopList returns property as a list of Stops.
func (*Properties) GetStringList ¶
func (p *Properties) GetStringList(property string) ([]string, bool)
GetStringList returns property as a list of strings, single string is converted to a slice.
func (*Properties) SetDefaultInstance ¶
func (p *Properties) SetDefaultInstance(instance string)
SetDefaultInstance sets the instance name used for all following GetXXX calls.
func (*Properties) String ¶
func (p *Properties) String() string