Expand description
§WaterUI Map Component
This crate provides a declarative map component for the WaterUI framework.
It displays native maps where a platform has a suitable primitive and a
shared GPU-drawn vector map elsewhere, with annotations and WaterKit
location integration.
§Example
ⓘ
use waterui_map::{Annotation, Coordinate, Map, Region};
// Display a map centered on San Francisco
let san_francisco = Coordinate::from_degrees(37.7749, -122.4194)?;
let region = Region::new(san_francisco, 0.1, 0.1);
let map = Map::new(region)
.annotations(vec![Annotation::new(san_francisco, "San Francisco")])
.shows_user_location(true);Re-exports§
pub use waterkit_location as location;
Structs§
- Annotation
- A map annotation (pin marker).
- Coordinate
- A geographic coordinate with latitude and longitude.
- Latitude
- Geographic latitude in degrees,
-90.0..=90.0. - Location
- A geographic location with coordinates and metadata.
- Longitude
- Geographic longitude in degrees,
-180.0..=180.0. - Map
- A map view that displays a geographic region with optional annotations.
- MapConfig
- Configuration for the Map component.
- OutOf
Range - Error returned by unit constructors when the input is out of range.
- Region
- A map region defined by a center coordinate and span.
- Timestamp
- An instant in time represented as the number of nanoseconds since the Unix epoch.
Enums§
- MapInteractivity
- Controls whether the user can pan and zoom the map.
- MapStatus
- Lifecycle of the imagery backing a map.
- MapStyle
- Map display style.
- MapVisibility
- Generic visibility toggle for optional map chrome.
Functions§
- map
- Convenience function to create a Map view.
- map_
centered_ on - Convenience constructor for
Map::centered_on. - map_
centered_ on_ location - Convenience constructor for
Map::centered_on_location.