1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! MapLibre layer filters → ezu.
//!
//! A layer's `filter` is routed by [`layer_filter_expr`] through
//! `maplibre_expr::convert_legacy_filter`, which:
//!
//! - passes **expression-form** filters through verbatim as a raw `filter-expr`
//! (ezu-paint evaluates them via the `maplibre-expr` crate — full fidelity,
//! including `any`, `has`/`!has`, `<`/`>`, `geometry-type`/`$type`, etc.);
//! - converts **legacy-form** filters (bare property names, `!in`/`!has`/`none`)
//! to the equivalent expression — the same conversion MapLibre itself applies
//! before compiling;
//! - and rewrites the legacy leaves of a **mixed** `all`/`any`/`none` combiner
//! (one MapLibre would reject) so real-world styles such as the Protomaps
//! basemap still render, rather than leaving a raw legacy operator for the
//! evaluator to reject.
//!
//! Only a structurally malformed legacy filter is reported and left unfiltered.
use Value;
use crateReport;
/// The raw expression filter to attach to a layer's features node, if any.
///
/// Expression-form filters pass through verbatim; legacy-form filters are
/// converted to expressions (matching MapLibre's own conversion). A malformed
/// legacy filter → `None` plus a warning; the layer is left unfiltered.
pub