@@ -14,7 +14,7 @@ use galileo::layer::vector_tile_layer::style::{
1414use galileo:: tile_schema:: { TileSchema , TileSchemaBuilder , VerticalDirection } ;
1515use serde:: Deserialize ;
1616
17- use crate :: layer:: { UNSUPPORTED , log_unsupported } ;
17+ use crate :: layer:: { UNSUPPORTED , log_unsupported_field } ;
1818use crate :: style:: color:: MlColor ;
1919use crate :: style:: layer:: { FillLayer , Layer as MaplibreStyleLayer , LineLayer } ;
2020use crate :: style:: source:: { TileScheme , VectorSource } ;
@@ -188,6 +188,10 @@ fn build_rules(layers: &[&MaplibreStyleLayer], tile_schema: &TileSchema) -> Vec<
188188 let mut rules = Vec :: new ( ) ;
189189 for & layer in layers {
190190 match layer {
191+ MaplibreStyleLayer :: Background ( _) => {
192+ // Handled by `get_background` function
193+ continue ;
194+ }
191195 MaplibreStyleLayer :: Fill ( fill) => {
192196 if let Some ( rule) = fill_rule ( fill, tile_schema) {
193197 rules. push ( rule) ;
@@ -236,26 +240,31 @@ fn fill_rule(fill: &FillLayer, tile_schema: &TileSchema) -> Option<StyleRule> {
236240 let fill_opacity = & fill. paint . fill_opacity ;
237241 let color = get_color_value ( fill_color, fill_opacity) ?;
238242
239- log_unsupported ! ( fill. paint. fill_antialias) ;
240- log_unsupported ! ( fill. paint. fill_outline_color) ;
241- log_unsupported ! ( fill. paint. fill_pattern) ;
242- log_unsupported ! ( fill. paint. fill_translate) ;
243- log_unsupported ! ( fill. paint. fill_translate_anchor) ;
244- log_unsupported ! ( fill. paint. fill_emissive_strength) ;
243+ log_unsupported_field ! ( fill. paint. fill_antialias) ;
244+ log_unsupported_field ! ( fill. paint. fill_outline_color) ;
245+ log_unsupported_field ! ( fill. paint. fill_pattern) ;
246+ log_unsupported_field ! ( fill. paint. fill_translate) ;
247+ log_unsupported_field ! ( fill. paint. fill_translate_anchor) ;
248+ log_unsupported_field ! ( fill. paint. fill_emissive_strength) ;
245249
246250 let min_resolution = fill
247251 . maxzoom
248252 . and_then ( |lod| tile_schema. lod_resolution ( lod. round ( ) as u32 ) ) ;
249253 let max_resolution = fill
250254 . minzoom
251255 . and_then ( |lod| tile_schema. lod_resolution ( lod. round ( ) as u32 ) ) ;
256+ let filter = fill
257+ . filter
258+ . as_ref ( )
259+ . map ( |v| v. to_prop_filters ( ) )
260+ . unwrap_or_default ( ) ;
252261
253262 Some ( StyleRule {
254263 layer_name : Some ( source_layer) ,
255264 symbol : VectorTileSymbol :: Polygon ( VectorTilePolygonSymbol { fill_color : color } ) ,
256265 min_resolution,
257266 max_resolution,
258- .. Default :: default ( )
267+ properties : filter ,
259268 } )
260269}
261270
@@ -269,14 +278,14 @@ fn line_rule(line: &LineLayer, tile_schema: &TileSchema) -> Option<StyleRule> {
269278 return None ;
270279 }
271280
272- log_unsupported ! ( line. paint. line_blur) ;
273- log_unsupported ! ( line. paint. line_gap_width) ;
274- log_unsupported ! ( line. paint. line_gradient) ;
275- log_unsupported ! ( line. paint. line_pattern) ;
276- log_unsupported ! ( line. paint. line_translate) ;
277- log_unsupported ! ( line. paint. line_translate_anchor) ;
278- log_unsupported ! ( line. paint. line_emissive_strength) ;
279- log_unsupported ! ( line. paint. line_offset) ;
281+ log_unsupported_field ! ( line. paint. line_blur) ;
282+ log_unsupported_field ! ( line. paint. line_gap_width) ;
283+ log_unsupported_field ! ( line. paint. line_gradient) ;
284+ log_unsupported_field ! ( line. paint. line_pattern) ;
285+ log_unsupported_field ! ( line. paint. line_translate) ;
286+ log_unsupported_field ! ( line. paint. line_translate_anchor) ;
287+ log_unsupported_field ! ( line. paint. line_emissive_strength) ;
288+ log_unsupported_field ! ( line. paint. line_offset) ;
280289
281290 let source_layer = match & line. source_layer {
282291 Some ( l) => l. clone ( ) ,
@@ -301,6 +310,11 @@ fn line_rule(line: &LineLayer, tile_schema: &TileSchema) -> Option<StyleRule> {
301310 let max_resolution = line
302311 . minzoom
303312 . and_then ( |lod| tile_schema. lod_resolution ( lod. round ( ) as u32 ) ) ;
313+ let filter = line
314+ . filter
315+ . as_ref ( )
316+ . map ( |v| v. to_prop_filters ( ) )
317+ . unwrap_or_default ( ) ;
304318
305319 Some ( StyleRule {
306320 layer_name : Some ( source_layer) ,
@@ -310,7 +324,7 @@ fn line_rule(line: &LineLayer, tile_schema: &TileSchema) -> Option<StyleRule> {
310324 } ) ,
311325 min_resolution,
312326 max_resolution,
313- .. Default :: default ( )
327+ properties : filter ,
314328 } )
315329}
316330
0 commit comments