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.
Members
name
name: String
process_index
process_index: i32
is_visible
is_visible: bool
stroke
stroke: Option<ferroui_base::media::Color>
fill
fill: Option<ferroui_base::media::Color>
new
fn new(name: impl Into<String>, stroke: Option<Color>, fill: Option<Color>) -> Self
lands
fn lands(self: &Self) -> impl Iterator<Item = (&str, &LandDefinition)>
The lands and their keys, in the order they were read.
land_count
fn land_count(self: &Self) -> usize
The number of lands.
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.
land_at
fn land_at(self: &Self, index: usize) -> Option<&LandDefinition>
The land at the given position in the order the lands were read.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneDebugStructuralPartialEqPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.