plepe/pgmapcss

Order objects during execution

plepe opened this issue · 2 comments

Execution order of objects should be influenced by special pseudo tags. The order applies only for the given rule - subsequent rules may have different order.

The following pseudo classes will be implemented:

  • :order-numerical()
  • :order-alphabetical()
  • :order-natural()

The pseudo classes will take at least one, but up to three parameters:

  1. First parameter: the value by which will be ordered. Can be either a tag key or an eval expression.
  2. Second argument (optional): specify order direction, e.g. 'asc' or 'desc'. -> :order-numerical(ele, desc).
  3. An optional third parameter defines the default value (if the first parameter evaluates to none) -> :order-numerical(ele, desc, 0).

The idea for :order-* was first born in #77 .

Alternative:

  • :order-numerical-asc() and :order-numerical-desc() <- would be simpler to handle, as every parameter can be an eval function. Or, we rather need a single parameter, the "default value" can be emulated by using :order-numerical-asc(any(tag("ele"), 0)).

In #109 I implemented the pseudo classes as stated in my last comment.