@@ -17,6 +17,7 @@ use serde::Deserialize;
1717
1818use crate :: layer:: { UNSUPPORTED , log_unsupported_field} ;
1919use crate :: style:: color:: MlColor ;
20+ use crate :: style:: layer:: symbol:: SymbolPlacement ;
2021use crate :: style:: layer:: { FillLayer , Layer as MaplibreStyleLayer , LineLayer , SymbolLayer } ;
2122use crate :: style:: source:: { TileScheme , VectorSource } ;
2223use crate :: style:: value:: { FunctionStop , FunctionType , MlStyleValue } ;
@@ -271,7 +272,6 @@ fn symbol_rule(symbol: &SymbolLayer, tile_schema: &TileSchema) -> Option<StyleRu
271272 ) ?;
272273
273274 let ( font_family, weight, font_style) = parse_ml_fonts ( & symbol. layout . text_font ) ;
274- dbg ! ( & font_color) ;
275275
276276 let style = VtTextStyle {
277277 font_family,
@@ -295,16 +295,25 @@ fn symbol_rule(symbol: &SymbolLayer, tile_schema: &TileSchema) -> Option<StyleRu
295295 outline_color : outline_color. into ( ) ,
296296 } ;
297297
298- Some ( StyleRule {
299- layer_name : Some ( source_layer) ,
300- symbol : VectorTileSymbol :: Label ( VectorTileLabelSymbol {
301- pattern : symbol. layout . text_field . clone ( ) . unwrap_or_default ( ) ,
302- text_style : style,
298+ match symbol. layout . symbol_placement {
299+ Some ( SymbolPlacement :: Point ) | None => Some ( StyleRule {
300+ layer_name : Some ( source_layer) ,
301+ symbol : VectorTileSymbol :: Label ( VectorTileLabelSymbol {
302+ pattern : symbol. layout . text_field . clone ( ) . unwrap_or_default ( ) ,
303+ text_style : style,
304+ } ) ,
305+ min_resolution,
306+ max_resolution,
307+ filter : filter. map ( Into :: into) ,
303308 } ) ,
304- min_resolution,
305- max_resolution,
306- filter : filter. map ( Into :: into) ,
307- } )
309+ Some ( SymbolPlacement :: Line ) | Some ( SymbolPlacement :: LineCenter ) => {
310+ log:: debug!(
311+ "{UNSUPPORTED} Placing labels along lines is not supported yet. Layer '{}' is skipped." ,
312+ symbol. id
313+ ) ;
314+ None
315+ }
316+ }
308317}
309318
310319/// Parses Maplibre `text-font` entries into a font family list, [`FontWeight`], and [`FontStyle`].
0 commit comments