Skip to main content

mln_style/layers/
background_layer.rs

1use crate::layer::{LayerStyle, LayerTypeInfo, NoProperties, SourceKind, StyleLayerType};
2use crate::layers::background_layer_properties::{self, BackgroundPaintProperties};
3use crate::property::table::{PropertyTable, PropertyVisitor};
4
5/// The `background` layer type.
6pub struct Background;
7
8impl StyleLayerType for Background {
9    const INFO: LayerTypeInfo = LayerTypeInfo { name: "background", source: SourceKind::None, from_json: true };
10    const PROPERTIES: &'static PropertyTable = &background_layer_properties::PROPERTIES;
11
12    type LayoutProperties = NoProperties;
13    type PaintProperties = BackgroundPaintProperties::Transitionable;
14    type Extra = ();
15
16    fn visit_property<V: PropertyVisitor<LayerStyle<Self>>>(slot: usize, visitor: V) -> Option<V::Output> {
17        background_layer_properties::visit(slot, visitor)
18    }
19}