MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / eachRule

Method eachRule

src/common/style/CartoCSS.js:3371–3392  ·  view source on GitHub ↗
(rule)

Source from the content-addressed store, hash-verified

3369 _if = filters.join(" && ");
3370
3371 function eachRule(rule) {
3372 if (rule instanceof CartoCSS.Tree.Rule) {
3373 shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
3374 if (_if) {
3375 shaderAttrs[rule.name].push(
3376 "if(" + _if + "){" + rule.value.toJS(env) + "}"
3377 );
3378 } else {
3379 shaderAttrs[rule.name].push(rule.value.toJS(env));
3380 }
3381 } else {
3382 if (rule instanceof CartoCSS.Tree.Ruleset) {
3383 var sh = rule.toJS(env);
3384 for (var v in sh) {
3385 shaderAttrs[v] = shaderAttrs[v] || [];
3386 for (var attr in sh[v]) {
3387 shaderAttrs[v].push(sh[v][attr]);
3388 }
3389 }
3390 }
3391 }
3392 }
3393 for (var id in this.rules) {
3394 eachRule(this.rules[id]);
3395 }

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
toJSMethod · 0.45

Tested by

no test coverage detected