FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ControlCoordinatesProjector

    struct · ferroui-livecharts · v0.5.0

    struct ControlCoordinatesProjector
    

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

    View source

    Members

    DEFAULT_MIN_LATITUDE

    const DEFAULT_MIN_LATITUDE: f64
    

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

    Source

    DEFAULT_MAX_LATITUDE

    const DEFAULT_MAX_LATITUDE: f64
    

    Source

    DEFAULT_MIN_LONGITUDE

    const DEFAULT_MIN_LONGITUDE: f64
    

    Source

    DEFAULT_MAX_LONGITUDE

    const DEFAULT_MAX_LONGITUDE: f64
    

    Source

    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.

    Source

    preferred_ratio

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

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

    Source

    map_width

    fn map_width(self: &Self) -> f64
    

    Source

    map_height

    fn map_height(self: &Self) -> f64
    

    Source

    x_offset

    fn x_offset(self: &Self) -> f64
    

    Source

    y_offset

    fn y_offset(self: &Self) -> f64
    

    Source

    to_map

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

    Source

    to_coordinates

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

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

    Source

    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
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.