Class: RuleHelper service:ngeoRuleHelper

ngeo.RuleHelper

new RuleHelper(gettextCatalog, ngeoFeatureHelper, ngeoWMSTime)

A service that provides utility methods to create ngeo.rule.Rule objects.

Parameters:
Name Type Description
gettextCatalog !angularGettext.Catalog

Gettext service.

ngeoFeatureHelper !ngeo.FeatureHelper

Ngeo feature helper service.

ngeoWMSTime !ngeo.WMSTime

wms time service.

Methods

cloneRule(rule)

Create a new ngeo.rule.Rule object using an other given rule.

Parameters:
Name Type Description
rule !ngeo.rule.Rule

Original rule to clone.

Returns:
!ngeo.rule.Rule

A clone rule.

createFilter(options)

Create a ol.format.filter.Filter object for a given data source. See the ngeox.CreateFilterOptions to learn more.

Parameters:
Name Type Description
options ngeox.CreateFilterOptions

Options.

Returns:

createFilterString(options)

Parameters:
Name Type Description
options ngeox.CreateFilterOptions

Options.

Returns:
?string

Filter string.

createRule(options)

Parameters:
Name Type Description
options !ngeox.rule.RuleOptions|!ngeox.rule.SelectOptions

Options

Returns:

createRuleFromAttribute(attribute, [opt_isCustom]opt)

Parameters:
Name Type Attributes Description
attribute !ngeox.Attribute

Attribute.

[opt_isCustom] boolean= <optional>

Whether the created rule should be marked as custom or not. Defaults to false.

Returns:

createRules(optionsList)

Parameters:
Name Type Description
optionsList !Array.|!ngeox.rule.SelectOptions>

List of options

Returns:
Array.

Rules.

createRulesFromAttributes(attributes, [opt_isCustom]opt)

Parameters:
Name Type Attributes Description
attributes !Array.

Attributes.

[opt_isCustom] boolean= <optional>

Whether the created rules should be marked as custom or not. Defaults to false.

Returns:
Array.

Rules.

extendRule(sourceRule, destRule)

Extend the dynamic properties from a source rule to destination rule. The source rule remains unchanged, while the destination rule changes.

Parameters:
Name Type Description
sourceRule !ngeo.rule.Rule

Source rule to collect the dynamic properties from.

destRule !ngeo.rule.Rule

Destination rule where the dynamic properties are set.

serializeRule(rule)

Selialize a rule into options to re-create it later.

Parameters:
Name Type Description
rule !ngeo.rule.Rule

Rule to serialize.

Returns:
!ngeox.rule.AnyOptions

Serialized rule options.

serializeRules(rules)

Parameters:
Name Type Description
rules !Array.

Rules

Returns:
!Array.

List of serialized rule options.