Expand description
§dioxus-maplibre
A MapLibre GL JS wrapper for Dioxus 0.7+
This crate provides a Map component and MapHandle API for integrating
MapLibre GL JS maps into your Dioxus applications.
§Example
ⓘ
use dioxus::prelude::*;
use dioxus_maplibre::{Map, MapHandle, LatLng, FlyToOptions};
fn App() -> Element {
let mut map = use_signal(|| None::<MapHandle>);
rsx! {
Map {
style: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",
center: LatLng::new(60.17, 24.94),
zoom: 12.0,
on_ready: move |handle: MapHandle| {
map.set(Some(handle));
},
}
}
}Re-exports§
pub use components::Map;pub use components::MapControl;pub use components::MapControlKind;pub use components::MapLayer;pub use components::MapMarker;pub use components::MapPopup;pub use components::MapSource;pub use components::MapSourceKind;pub use components::use_map_handle;
Modules§
- components
- Map components Dioxus components and hooks for MapLibre GL JS.
Structs§
- Bounds
- A bounding box defined by southwest and northeast corners
- Ease
ToOptions - Options for
ease_toanimation - Feature
Identifier - Identifies a feature for feature state operations
- FitBounds
Options - Options for
fit_bounds - FlyTo
Options - Options for
fly_toanimation - FogOptions
- Options for setting fog/atmosphere (passthrough to MapLibre spec)
- GeoJson
Source Options - Options for adding a GeoJSON source
- Image
Source Options - Options for adding an image source
- Jump
ToOptions - Options for
jump_to(instant, no animation) - LatLng
- A geographic coordinate (latitude/longitude pair)
- Layer
Click Event - Event fired when a feature in a layer is clicked
- Layer
Hover Event - Event fired when hovering over a feature in a layer
- Layer
Options - Options for adding a map layer
- MapClick
Event - Event fired when the map is clicked
- MapContext
Menu Event - Event fired on right-click / context menu
- MapDbl
Click Event - Event fired when the map is double-clicked
- MapError
Event - Event fired when bridge reports an initialization/runtime error
- MapHandle
- A handle to a MapLibre map instance.
- MapMove
Event - Event fired when the map view changes (pan/zoom)
- MapPitch
Event - Event fired when the pitch changes
- MapPosition
- Map position (center + zoom)
- MapReady
Event - Event fired when map initialization succeeds
- MapRotate
Event - Event fired when the bearing (rotation) changes
- MapZoom
Event - Event fired when the zoom level changes
- Marker
Click Event - Event fired when a marker is clicked
- Marker
Drag EndEvent - Event fired when a draggable marker is dropped after dragging
- Marker
Drag Start Event - Event fired when a draggable marker starts being dragged
- Marker
Hover Event - Event fired when hovering over a marker
- Marker
Options - Options for adding a marker to the map
- Padding
- Padding values for map viewport operations.
- Point
- A point in screen pixel coordinates
- Popup
Options - Options for creating a popup
- Query
Feature - A feature returned by query methods (
queryRenderedFeatures,querySourceFeatures) - Query
Options - Options for querying rendered or source features
- Raster
DemSource Options - Options for adding a raster DEM source (for terrain)
- Raster
Source Options - Options for adding a raster tile source
- SkyOptions
- Options for setting sky (passthrough to MapLibre spec)
- Terrain
Options - Options for setting terrain
- Vector
Source Options - Options for adding a vector tile source
Enums§
- Control
Position - Position of a map control on the map canvas.
- MapEvent
- Internal event enum for communication from JS