Skip to main content

mln_style/layers/
heatmap_layer.rs

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