ControlCoordinatesProjector
struct · ferroui-livecharts · v0.5.0
struct ControlCoordinatesProjector
Longitude and latitude mapped linearly to the map area, from the top-left corner.
Members
DEFAULT_MIN_LATITUDEDEFAULT_MAX_LATITUDEDEFAULT_MIN_LONGITUDEDEFAULT_MAX_LONGITUDEnewpreferred_ratiomap_widthmap_heightx_offsety_offsetto_mapto_coordinates
DEFAULT_MIN_LATITUDE
const DEFAULT_MIN_LATITUDE: f64
The whole earth: from -90 to 90 degrees of latitude.
DEFAULT_MAX_LATITUDE
const DEFAULT_MAX_LATITUDE: f64
DEFAULT_MIN_LONGITUDE
const DEFAULT_MIN_LONGITUDE: f64
DEFAULT_MAX_LONGITUDE
const DEFAULT_MAX_LONGITUDE: f64
new
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.
preferred_ratio
fn preferred_ratio(bounds: GeographicBounds) -> [f64; 2]
The aspect ratio, width to height, of the framed bounds (GetPreferredRatio).
map_width
fn map_width(self: &Self) -> f64
map_height
fn map_height(self: &Self) -> f64
x_offset
fn x_offset(self: &Self) -> f64
y_offset
fn y_offset(self: &Self) -> f64
to_map
fn to_map(self: &Self, longitude: f64, latitude: f64) -> Point
to_coordinates
fn to_coordinates(self: &Self, screen: Point) -> Option<(f64, f64)>
The linear inverse: every position has a coordinate, possibly outside the bounds.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneDebugStructuralPartialEqPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.