FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MapLayer

    struct · ferroui-livecharts · v0.5.0

    struct MapLayer
    

    A named layer of lands (MapLayer). The stroke and fill of a layer draw it when the chart has no stroke or fill of its own; the visible layers are drawn by descending process_index.

    View source

    Members

    name

    name: String
    

    Source

    process_index

    process_index: i32
    

    Source

    is_visible

    is_visible: bool
    

    Source

    stroke

    stroke: Option<ferroui_base::media::Color>
    

    Source

    fill

    fill: Option<ferroui_base::media::Color>
    

    Source

    new

    fn new(name: impl Into<String>, stroke: Option<Color>, fill: Option<Color>) -> Self
    

    Source

    lands

    fn lands(self: &Self) -> impl Iterator<Item = (&str, &LandDefinition)>
    

    The lands and their keys, in the order they were read.

    Source

    land_count

    fn land_count(self: &Self) -> usize
    

    The number of lands.

    Source

    land

    fn land(self: &Self, key: &str) -> Option<&LandDefinition>
    

    The land of the given key (its short name, or the short name with the index of its feature when two features share it); the key is case-sensitive, as in the source.

    Source

    land_at

    fn land_at(self: &Self, index: usize) -> Option<&LandDefinition>
    

    The land at the given position in the order the lands were read.

    Source

    add_geojson

    fn add_geojson(self: &mut Self, json: &str) -> Result<usize, ChartError>
    

    Reads the polygon features of a GeoJSON feature collection into the layer (AddFile). Polygon and MultiPolygon geometries are read, other geometries and features without coordinates are skipped. A second feature with a short name already read takes the key <short name>_<feature index>. Malformed JSON, a file without features or a malformed polygon is an error that leaves the layer unchanged. Returns the number of lands read.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.