Skip to main content

MapProjectionHandle

Struct MapProjectionHandle 

Source
pub struct MapProjectionHandle { /* private fields */ }
Expand description

Standalone projection snapshot created from a map transform.

The projection does not retain the source map after creation. It remains usable from any thread, and native calls serialize access to its transform.

Implementations§

Source§

impl MapProjectionHandle

Source

pub fn close(self) -> Result<(), HandleOperationError<Self>>

Explicitly destroys the projection snapshot.

Source

pub fn camera(&self) -> Result<CameraOptions>

Reads the projection helper’s current camera snapshot.

Source

pub fn set_camera(&self, camera: &CameraOptions) -> Result<()>

Applies camera fields to this projection helper.

Source

pub fn set_visible_coordinates( &self, coordinates: &[LatLng], padding: EdgeInsets, ) -> Result<()>

Updates the projection camera so coordinates are visible within padding.

Source

pub fn set_visible_geometry( &self, geometry: &[u8], padding: EdgeInsets, ) -> Result<()>

Updates the projection camera so geometry coordinates are visible.

Source

pub fn pixel_for_lat_lng(&self, coordinate: LatLng) -> Result<ScreenPoint>

Converts a geographic world coordinate to a screen point.

Source

pub fn lat_lng_for_pixel(&self, point: ScreenPoint) -> Result<LatLng>

Converts a screen point to a geographic world coordinate.

The longitude is wrapped to the range from -180 to 180 degrees.

Source

pub fn lat_lng_for_pixel_unwrapped(&self, point: ScreenPoint) -> Result<LatLng>

Converts a screen point to an unwrapped geographic coordinate.

The longitude preserves the visible world copy and may fall outside -180 to 180.

Trait Implementations§

Source§

impl Debug for MapProjectionHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.