[Feature]: Extend rule-based symbology — per-rule symbol properties, scale ranges, and nested rules
enhancement
### What problem does this solve?
#583 landed a first version of the rule-based renderer: a flat list of rules, each pairing a MapLibre filter with a **single fill/circle color**, evaluated top-to-bottom with an optional else-rule (`VectorRule` in `packages/core/src/types.ts`). That covers the "color by rule" case, but it is still far from what makes the QGIS rule-based renderer the go-to tool for professional cartography. Today a rule cannot change anything *except* color, cannot be limited to a zoom/scale range, and cannot be organized hierarchically — so workflows like "highways get a wide casing at low zoom, minor roads only appear past z12, and each class has its own line width and dash pattern" still require abandoning the renderer for raw expression mode.
### Proposed solution
Extend the rule-based renderer toward QGIS parity, roughly in this order:
1. **Per-rule symbol properties** — each rule carries a full symbol, not just a color: size/width, opacity, outline color/width, dash pattern, fill pattern, and marker shape for points (reusing the existing `FillPattern` / `MarkerShape` machinery from the single-symbol style). Compiles to per-property `case`/match expressions or, where needed, one MapLibre layer per rule.
2. **Per-rule scale range** — optional min/max zoom on each rule (QGIS "scale range"), compiled into the filter via `["zoom"]` expressions or per-rule layer `minzoom`/`maxzoom`.
3. **Nested rule groups** — child rules AND their parent's filter (QGIS rule tree), with collapse/expand and group-level enable toggles in the editor and the legend.
4. **Per-rule toggles** — the checkbox to temporarily disable a rule without deleting it, mirrored in the legend.
Round-tripping through the existing QML/SLD import/export (`packages/map/src/qml-*.ts`, `sld-*.ts`) should be extended alongside, since QGIS QML files commonly carry scale ranges and nested rules that currently have nowhere to land.
### Alternatives considered
Leaving power users on the raw `expression` style mode works but is write-only: expressions are hard to read back, don't produce a structured legend, and can't be edited incrementally by non-experts.
### Scope
enhancement (medium) — the store schema, style compiler, and editor UI all exist from #583; this extends each rather than starting fresh.
0 条评论