dioxus_maplibre/lib.rs
1//! # dioxus-maplibre
2//!
3//! A MapLibre GL JS wrapper for Dioxus 0.7+
4//!
5//! This crate provides a `Map` component and `MapHandle` API for integrating
6//! MapLibre GL JS maps into your Dioxus applications.
7//!
8//! ## Example
9//!
10//! ```rust,ignore
11//! use dioxus::prelude::*;
12//! use dioxus_maplibre::{Map, MapHandle, LatLng, FlyToOptions};
13//!
14//! fn App() -> Element {
15//! let mut map = use_signal(|| None::<MapHandle>);
16//!
17//! rsx! {
18//! Map {
19//! style: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",
20//! center: LatLng::new(60.17, 24.94),
21//! zoom: 12.0,
22//! on_ready: move |handle: MapHandle| {
23//! map.set(Some(handle));
24//! },
25//! }
26//! }
27//! }
28//! ```
29
30mod events;
31mod handle;
32mod interop;
33mod options;
34mod types;
35
36/// Map components
37pub mod components;
38
39// Re-export public API — Types
40pub use types::{Bounds, LatLng, MapPosition, Point, QueryFeature};
41
42// Re-export public API — Events
43pub use events::{
44 LayerClickEvent, LayerHoverEvent, MapClickEvent, MapContextMenuEvent, MapDblClickEvent,
45 MapErrorEvent, MapEvent, MapMoveEvent, MapPitchEvent, MapReadyEvent, MapRotateEvent,
46 MapZoomEvent, MarkerClickEvent, MarkerDragEndEvent, MarkerDragStartEvent, MarkerHoverEvent,
47};
48
49// Re-export public API — Options
50pub use options::{
51 ControlPosition, EaseToOptions, FeatureIdentifier, FitBoundsOptions, FlyToOptions, FogOptions,
52 GeoJsonSourceOptions, ImageSourceOptions, JumpToOptions, LayerOptions, MarkerOptions, Padding,
53 PopupOptions, QueryOptions, RasterDemSourceOptions, RasterSourceOptions, SkyOptions,
54 TerrainOptions, VectorSourceOptions,
55};
56
57// Re-export public API — Handle & Component
58pub use components::{
59 Map, MapControl, MapControlKind, MapLayer, MapMarker, MapPopup, MapSource, MapSourceKind,
60 use_map_handle,
61};
62pub use handle::MapHandle;