1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! slint-mapping — a map framework for Slint.
//!
//! Minimal usage (offline raster tiles from a slippy-map directory):
//!
//! ```ignore
//! use slint::ComponentHandle;
//! use slint_mapping::{MapView, MapController, sources::FileTileSource};
//!
//! let map = MapView::new()?;
//! let _controller = MapController::new(
//! &map,
//! FileTileSource::new("/data/osm-tiles").with_extension("png"),
//! );
//! map.show()?;
//! slint::run_event_loop()?;
//! ```
//!
//! ## Adapters
//!
//! Tile sources are pluggable: implement [`TileSource`] for any
//! backing store (filesystem, MBTiles, in-memory generator, HTTP cache,
//! …). [`sources::FileTileSource`] is the only adapter that ships
//! today.
//!
//! ## Status
//!
//! v0.x. Pan + scroll-zoom work; pinch-zoom waits on Slint exposing
//! multi-pointer touch events. No marker / polyline overlays yet.
include_modules!;
pub use ;
pub use MapController;
pub use ;
pub use ;
/// Filesystem path to this crate's `ui/` directory — the entry point
/// Slint resolves `@mapping/...` library_paths imports against. Pass
/// this (wrapped in a `PathBuf`) to
/// `slint_build::CompilerConfiguration::with_library_paths` from a
/// consuming crate's `build.rs` and you can write
/// `import { MapEmbed } from "@mapping/map.slint";` in your `.slint`
/// files.
pub const UI_LIBRARY_DIR: &str = concat!;
/// Filesystem path to this crate's bundled `sample-tiles/` directory.
/// Suitable for feeding into [`sources::FileTileSource`] for demos
/// without external assets; covers zoom levels 0–3 (the whole world,
/// 85 tiles, ~450 KB).
pub const SAMPLE_TILES_DIR: &str = concat!;