# MapProjector

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-livecharts/geo/enum-mapprojector/

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

```rust
enum MapProjector
```

A projector built for one map area (`MapProjector`): the source's abstract class is the enum
of its three projections. Screen positions are `f64` where the source uses `float`.

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

## Members

- [`Default`](#variant-default)
- [`Mercator`](#variant-mercator)
- [`Orthographic`](#variant-orthographic)
- [`map_width`](#function-map_width)
- [`map_height`](#function-map_height)
- [`x_offset`](#function-x_offset)
- [`y_offset`](#function-y_offset)
- [`map_rect`](#function-map_rect)
- [`to_map`](#function-to_map)
- [`is_visible`](#function-is_visible)
- [`to_coordinates`](#function-to_coordinates)
- [`as_orthographic`](#function-as_orthographic)

<a id="variant-default"></a>

### Default

```rust
Default(super::ControlCoordinatesProjector)
```



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

<a id="variant-mercator"></a>

### Mercator

```rust
Mercator(super::MercatorProjector)
```



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

<a id="variant-orthographic"></a>

### Orthographic

```rust
Orthographic(super::OrthographicProjector)
```



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

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

### map_width

```rust
fn map_width(self: &Self) -> f64
```

The width of the map area.

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

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

### map_height

```rust
fn map_height(self: &Self) -> f64
```

The height of the map area.

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

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

### x_offset

```rust
fn x_offset(self: &Self) -> f64
```

The left of the map area.

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

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

### y_offset

```rust
fn y_offset(self: &Self) -> f64
```

The top of the map area.

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

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

### map_rect

```rust
fn map_rect(self: &Self) -> ferroui_base::Rect
```

The map area, which the chart clips the lands to.

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

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

### to_map

```rust
fn to_map(self: &Self, longitude: f64, latitude: f64) -> Point
```

Projects a longitude and latitude, in degrees, to the screen (`ToMap`).

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

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

### is_visible

```rust
fn is_visible(self: &Self, longitude: f64, latitude: f64) -> bool
```

Whether the coordinate is on the visible side of the projection (`IsVisible`); always
true for the flat projections.

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

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

### to_coordinates

```rust
fn to_coordinates(self: &Self, screen: Point) -> Option<(f64, f64)>
```

The inverse of `Self::to_map` (`ToCoordinates`): the longitude and latitude of a screen
position, `None` where the projection has none (outside the disc of a globe).

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

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

### as_orthographic

```rust
fn as_orthographic(self: &Self) -> Option<&OrthographicProjector>
```

The globe of an orthographic projector.

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

## 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/).
