Skip to main content

Map

Struct Map 

Source
pub struct Map(/* private fields */);
Expand description

A map view that displays a geographic region with optional annotations.

Implementations§

Source§

impl Map

Source

pub fn new(region: impl IntoComputed<Region>) -> Self

Creates a new Map displaying the specified region.

§Arguments
  • region - The map region to display (can be reactive).
Source

pub fn centered_on(coordinate: impl IntoComputed<Coordinate>) -> Self

Creates a new Map centered on the specified coordinate with default zoom.

Source

pub fn centered_on_location(location: impl IntoComputed<Location>) -> Self

Creates a new Map centered on reactive Location values.

Source

pub fn annotations( self, annotations: impl IntoComputed<Vec<Annotation>>, ) -> Self

Sets the annotations (pins) to display on the map.

Source

pub const fn style(self, style: MapStyle) -> Self

Sets the map display style.

Source

pub const fn shows_user_location(self, show: bool) -> Self

Sets whether to show the user’s current location on the map.

Source

pub fn user_location(self, location: impl IntoComputed<Location>) -> Self

Displays reactive WaterKit location values and their horizontal accuracy.

Source

pub fn optional_user_location( self, location: impl IntoComputed<Option<Location>>, ) -> Self

Displays an optional reactive WaterKit location.

This is useful while an asynchronous location permission/request flow is pending: None draws no location marker and the first Some value updates the existing map without replacing its view identity.

Source

pub fn follows_location(self, location: impl IntoComputed<Location>) -> Self

Binds the map center to reactive Location updates and enables user-location display.

Source

pub const fn is_interactive(self, interactive: bool) -> Self

Sets whether the map is interactive (pan/zoom enabled).

Source

pub const fn shows_compass(self, show: bool) -> Self

Sets whether to show the compass.

Source

pub const fn shows_scale(self, show: bool) -> Self

Sets whether to show the scale.

Source

pub fn status(self, status: &Binding<MapStatus>) -> Self

Observes the map’s load lifecycle through a caller-owned binding.

The map writes MapStatus into status as it loads, fails, or becomes ready, so an application can show its own loading and error affordances over the map.

Trait Implementations§

Source§

impl ConfigurableView for Map

Source§

type Config = MapConfig

The configuration type associated with this view. Read more
Source§

fn config(self) -> Self::Config

Returns the configuration for this view. Read more
Source§

impl From<MapConfig> for Map

Source§

fn from(value: MapConfig) -> Self

Converts to this type from the input type.
Source§

impl View for Map

Source§

fn body(self, env: &Environment) -> impl View

Build this view and return the content. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Map

§

impl !Send for Map

§

impl !Sync for Map

§

impl !UnwindSafe for Map

§

impl Freeze for Map

§

impl Unpin for Map

§

impl UnsafeUnpin for Map

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> IdentifiableExt for T

Source§

fn use_id<F, Id>(self, f: F) -> UseId<Self, F>
where F: Fn(&Self) -> Id, Id: Ord + Hash,

Wraps the value in a UseId with the provided identification function.
Source§

fn self_id(self) -> SelfId<Self>

Wraps the value in a SelfId, making the value serve as its own identifier.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<V> IntoView for V
where V: View,

Source§

type Output = V

The resulting View type after conversion.
Source§

fn into_view(self, _env: &Environment) -> <V as IntoView>::Output

Converts the implementing type into a View. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more