pub struct Map(/* private fields */);Expand description
A map view that displays a geographic region with optional annotations.
Implementations§
Source§impl Map
impl Map
Sourcepub fn new(region: impl IntoComputed<Region>) -> Self
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).
Sourcepub fn centered_on(coordinate: impl IntoComputed<Coordinate>) -> Self
pub fn centered_on(coordinate: impl IntoComputed<Coordinate>) -> Self
Creates a new Map centered on the specified coordinate with default zoom.
Sourcepub fn centered_on_location(location: impl IntoComputed<Location>) -> Self
pub fn centered_on_location(location: impl IntoComputed<Location>) -> Self
Creates a new Map centered on reactive Location values.
Sourcepub fn annotations(
self,
annotations: impl IntoComputed<Vec<Annotation>>,
) -> Self
pub fn annotations( self, annotations: impl IntoComputed<Vec<Annotation>>, ) -> Self
Sets the annotations (pins) to display on the map.
Sourcepub const fn shows_user_location(self, show: bool) -> Self
pub const fn shows_user_location(self, show: bool) -> Self
Sets whether to show the user’s current location on the map.
Sourcepub fn user_location(self, location: impl IntoComputed<Location>) -> Self
pub fn user_location(self, location: impl IntoComputed<Location>) -> Self
Displays reactive WaterKit location values and their horizontal accuracy.
Sourcepub fn optional_user_location(
self,
location: impl IntoComputed<Option<Location>>,
) -> Self
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.
Sourcepub fn follows_location(self, location: impl IntoComputed<Location>) -> Self
pub fn follows_location(self, location: impl IntoComputed<Location>) -> Self
Binds the map center to reactive Location updates and enables user-location display.
Sourcepub const fn is_interactive(self, interactive: bool) -> Self
pub const fn is_interactive(self, interactive: bool) -> Self
Sets whether the map is interactive (pan/zoom enabled).
Sourcepub const fn shows_compass(self, show: bool) -> Self
pub const fn shows_compass(self, show: bool) -> Self
Sets whether to show the compass.
Sourcepub const fn shows_scale(self, show: bool) -> Self
pub const fn shows_scale(self, show: bool) -> Self
Sets whether to show the scale.