DrawnMap
struct · ferroui-livecharts · v0.5.0
struct DrawnMap
A map of named layers (DrawnMap), in the order they were added.
Members
DEFAULT_LAYERnewfrom_geojsonadd_layer_from_geojsonlayerslayerlayer_mutinsert_layerremove_layerfind_landfind_land_in
DEFAULT_LAYER
const DEFAULT_LAYER: &'static str
The name of the layer of a map read from one file.
new
fn new() -> Self
An empty map.
from_geojson
fn from_geojson(json: &str) -> Result<Self, ChartError>
A map of one layer, default, with the default layer paints.
add_layer_from_geojson
fn add_layer_from_geojson(self: &mut Self, json: &str, layer_name: &str, stroke: Option<Color>, fill: Option<Color>) -> Result<&mut MapLayer, ChartError>
Reads a GeoJSON file into the layer of the given name (AddLayerFromStreamReader); a
new layer takes the given paints, an existing one keeps its own.
layers
fn layers(self: &Self) -> &[MapLayer]
The layers, in the order they were added.
layer
fn layer(self: &Self, name: &str) -> Option<&MapLayer>
layer_mut
fn layer_mut(self: &mut Self, name: &str) -> Option<&mut MapLayer>
insert_layer
fn insert_layer(self: &mut Self, layer: MapLayer)
Adds a layer, or replaces the layer of the same name.
remove_layer
fn remove_layer(self: &mut Self, name: &str) -> Option<MapLayer>
find_land
fn find_land(self: &Self, short_name: &str) -> Option<&LandDefinition>
The land of the given key in the default layer (FindLand).
find_land_in
fn find_land_in(self: &Self, short_name: &str, layer_name: &str) -> Option<&LandDefinition>
The land of the given key in the given layer.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneDebugDefaultStructuralPartialEqPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.