# MapLayer

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-livecharts/geo/struct-maplayer/

**struct** · [`ferroui-livecharts`](/docs/0.5.0/api/ferroui-livecharts/) · v0.5.0

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L93)

## Members

- [`name`](#struct_field-name)
- [`process_index`](#struct_field-process_index)
- [`is_visible`](#struct_field-is_visible)
- [`stroke`](#struct_field-stroke)
- [`fill`](#struct_field-fill)
- [`new`](#function-new)
- [`lands`](#function-lands)
- [`land_count`](#function-land_count)
- [`land`](#function-land)
- [`land_at`](#function-land_at)
- [`add_geojson`](#function-add_geojson)

<a id="struct_field-name"></a>

### name

```rust
name: String
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L94)

<a id="struct_field-process_index"></a>

### process_index

```rust
process_index: i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L95)

<a id="struct_field-is_visible"></a>

### is_visible

```rust
is_visible: bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L96)

<a id="struct_field-stroke"></a>

### stroke

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L97)

<a id="struct_field-fill"></a>

### fill

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L98)

<a id="function-new"></a>

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L105)

<a id="function-lands"></a>

### lands

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L118)

<a id="function-land_count"></a>

### land_count

```rust
fn land_count(self: &Self) -> usize
```

The number of lands.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L122)

<a id="function-land"></a>

### land

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L127)

<a id="function-land_at"></a>

### land_at

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L131)

<a id="function-add_geojson"></a>

### add_geojson

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/drawn_map.rs#L140)

## 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`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
