# DrawnMap

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

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

```rust
struct DrawnMap
```

A map of named layers (`DrawnMap`), in the order they were added.

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

## Members

- [`DEFAULT_LAYER`](#assoc_const-default_layer)
- [`new`](#function-new)
- [`from_geojson`](#function-from_geojson)
- [`add_layer_from_geojson`](#function-add_layer_from_geojson)
- [`layers`](#function-layers)
- [`layer`](#function-layer)
- [`layer_mut`](#function-layer_mut)
- [`insert_layer`](#function-insert_layer)
- [`remove_layer`](#function-remove_layer)
- [`find_land`](#function-find_land)
- [`find_land_in`](#function-find_land_in)

<a id="assoc_const-default_layer"></a>

### DEFAULT_LAYER

```rust
const DEFAULT_LAYER: &'static str
```

The name of the layer of a map read from one file.

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

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

### new

```rust
fn new() -> Self
```

An empty map.

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

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

### from_geojson

```rust
fn from_geojson(json: &str) -> Result<Self, ChartError>
```

A map of one layer, `default`, with the default layer paints.

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

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

### add_layer_from_geojson

```rust
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.

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

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

### layers

```rust
fn layers(self: &Self) -> &[MapLayer]
```

The layers, in the order they were added.

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

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

### layer

```rust
fn layer(self: &Self, name: &str) -> Option<&MapLayer>
```



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

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

### layer_mut

```rust
fn layer_mut(self: &mut Self, name: &str) -> Option<&mut MapLayer>
```



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

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

### insert_layer

```rust
fn insert_layer(self: &mut Self, layer: MapLayer)
```

Adds a layer, or replaces the layer of the same name.

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

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

### remove_layer

```rust
fn remove_layer(self: &mut Self, name: &str) -> Option<MapLayer>
```



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

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

### find_land

```rust
fn find_land(self: &Self, short_name: &str) -> Option<&LandDefinition>
```

The land of the given key in the `default` layer (`FindLand`).

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

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

### find_land_in

```rust
fn find_land_in(self: &Self, short_name: &str, layer_name: &str) -> Option<&LandDefinition>
```

The land of the given key in the given layer.

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

## 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`
- `Default`
- `StructuralPartialEq`
- `PartialEq`

## Availability

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