Comparator sorting objects by a numeric order field.
Entries without an order fall back to 999, so unordered items sink to the end while
keeping a stable relation among themselves. Used for layers, legend entries and toolbar items.
Parameters
a: {order?:number}
First entry.
b: {order?:number}
Second entry.
fallback: number = 999
Rank given to entries with no order. Defaults to 999.
Returns number
Negative, zero or positive, per the Array.prototype.sort contract.
Comparator sorting objects by a numeric
orderfield.Entries without an
orderfall back to999, so unordered items sink to the end while keeping a stable relation among themselves. Used for layers, legend entries and toolbar items.