# ControlCoordinatesProjector

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

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

```rust
struct ControlCoordinatesProjector
```

Longitude and latitude mapped linearly to the map area, from the top-left corner.

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

## Members

- [`DEFAULT_MIN_LATITUDE`](#assoc_const-default_min_latitude)
- [`DEFAULT_MAX_LATITUDE`](#assoc_const-default_max_latitude)
- [`DEFAULT_MIN_LONGITUDE`](#assoc_const-default_min_longitude)
- [`DEFAULT_MAX_LONGITUDE`](#assoc_const-default_max_longitude)
- [`new`](#function-new)
- [`preferred_ratio`](#function-preferred_ratio)
- [`map_width`](#function-map_width)
- [`map_height`](#function-map_height)
- [`x_offset`](#function-x_offset)
- [`y_offset`](#function-y_offset)
- [`to_map`](#function-to_map)
- [`to_coordinates`](#function-to_coordinates)

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

### DEFAULT_MIN_LATITUDE

```rust
const DEFAULT_MIN_LATITUDE: f64
```

The whole earth: from -90 to 90 degrees of latitude.

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

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

### DEFAULT_MAX_LATITUDE

```rust
const DEFAULT_MAX_LATITUDE: f64
```



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

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

### DEFAULT_MIN_LONGITUDE

```rust
const DEFAULT_MIN_LONGITUDE: f64
```



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

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

### DEFAULT_MAX_LONGITUDE

```rust
const DEFAULT_MAX_LONGITUDE: f64
```



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

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

### new

```rust
fn new(map_width: f64, map_height: f64, offset_x: f64, offset_y: f64, bounds: GeographicBounds) -> Self
```

A projector of the map area of the given size at the given offset, framed on `bounds`.

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

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

### preferred_ratio

```rust
fn preferred_ratio(bounds: GeographicBounds) -> [f64; 2]
```

The aspect ratio, width to height, of the framed bounds (`GetPreferredRatio`).

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

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

### map_width

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



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

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

### map_height

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



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

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

### x_offset

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



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

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

### y_offset

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



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

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

### to_map

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



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

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

### to_coordinates

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

The linear inverse: every position has a coordinate, possibly outside the bounds.

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

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