MapProjector
enum · ferroui-livecharts · v0.5.0
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.
Members
DefaultMercatorOrthographicmap_widthmap_heightx_offsety_offsetmap_rectto_mapis_visibleto_coordinatesas_orthographic
Default
Default(super::ControlCoordinatesProjector)
Mercator
Mercator(super::MercatorProjector)
Orthographic
Orthographic(super::OrthographicProjector)
map_width
fn map_width(self: &Self) -> f64
The width of the map area.
map_height
fn map_height(self: &Self) -> f64
The height of the map area.
x_offset
fn x_offset(self: &Self) -> f64
The left of the map area.
y_offset
fn y_offset(self: &Self) -> f64
The top of the map area.
map_rect
fn map_rect(self: &Self) -> ferroui_base::Rect
The map area, which the chart clips the lands to.
to_map
fn to_map(self: &Self, longitude: f64, latitude: f64) -> Point
Projects a longitude and latitude, in degrees, to the screen (ToMap).
is_visible
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.
to_coordinates
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).
as_orthographic
fn as_orthographic(self: &Self) -> Option<&OrthographicProjector>
The globe of an orthographic projector.
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.