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
impl MapProjectionHandle
Sourcepub fn close(self) -> Result<(), HandleOperationError<Self>>
pub fn close(self) -> Result<(), HandleOperationError<Self>>
Explicitly destroys the projection snapshot.
Sourcepub fn camera(&self) -> Result<CameraOptions>
pub fn camera(&self) -> Result<CameraOptions>
Reads the projection helper’s current camera snapshot.
Sourcepub fn set_camera(&self, camera: &CameraOptions) -> Result<()>
pub fn set_camera(&self, camera: &CameraOptions) -> Result<()>
Applies camera fields to this projection helper.
Sourcepub fn set_visible_coordinates(
&self,
coordinates: &[LatLng],
padding: EdgeInsets,
) -> Result<()>
pub fn set_visible_coordinates( &self, coordinates: &[LatLng], padding: EdgeInsets, ) -> Result<()>
Updates the projection camera so coordinates are visible within padding.
Sourcepub fn set_visible_geometry(
&self,
geometry: &[u8],
padding: EdgeInsets,
) -> Result<()>
pub fn set_visible_geometry( &self, geometry: &[u8], padding: EdgeInsets, ) -> Result<()>
Updates the projection camera so geometry coordinates are visible.
Sourcepub fn pixel_for_lat_lng(&self, coordinate: LatLng) -> Result<ScreenPoint>
pub fn pixel_for_lat_lng(&self, coordinate: LatLng) -> Result<ScreenPoint>
Converts a geographic world coordinate to a screen point.
Sourcepub fn lat_lng_for_pixel(&self, point: ScreenPoint) -> Result<LatLng>
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.
Sourcepub fn lat_lng_for_pixel_unwrapped(&self, point: ScreenPoint) -> Result<LatLng>
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.