pub struct Zoom(f64);
Expand description
Zoom
is an exponential scale that defines the zoom of the camera on the map.
We can derive the ZoomLevel
from Zoom
by using the [crate::coords::ZOOM_BOUNDS]
.
Tuple Fields§
§0: f64
Implementations§
source§impl Zoom
impl Zoom
pub fn scale_to_tile(&self, coords: &WorldTileCoords) -> f64
pub fn scale_to_zoom_level(&self, z: ZoomLevel) -> f64
pub fn scale_delta(&self, zoom: &Zoom) -> f64
sourcepub fn zoom_level(&self, tile_size: f64) -> ZoomLevel
pub fn zoom_level(&self, tile_size: f64) -> ZoomLevel
Adopted from Transform::coveringZoomLevel
This function calculates which ZoomLevel to show at this zoom.
The tile_size
is the size of the tile like specified in the source definition,
For example raster tiles can be 512px or 256px. If it is 256px, then 2x as many tiles are
displayed. If the raster tile is 512px then exactly as many raster tiles like vector
tiles would be displayed.
Trait Implementations§
source§impl SignificantlyDifferent for Zoom
impl SignificantlyDifferent for Zoom
impl Copy for Zoom
Auto Trait Implementations§
impl Freeze for Zoom
impl RefUnwindSafe for Zoom
impl Send for Zoom
impl Sync for Zoom
impl Unpin for Zoom
impl UnwindSafe for Zoom
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more