Skip to main content

slint_mapping/sources/
mod.rs

1//! Concrete [`crate::TileSource`] implementations.
2//!
3//! Each adapter lives in its own submodule and is re-exported at this
4//! module's root. Adding a new source = drop a file in this directory,
5//! register it here.
6
7mod file;
8mod synthetic;
9pub use file::FileTileSource;
10pub use synthetic::SyntheticTileSource;
11
12// Shared helpers for both the native and the wasm HTTP tile sources
13// (URL templating + PNG decoding). Compiled in if either feature
14// requests them, since both share the same logic. `pub(crate)` so
15// sibling modules (osm, wasm_osm, prefetch) can import from it.
16#[cfg(any(feature = "http", feature = "wasm"))]
17pub(crate) mod util;
18
19#[cfg(feature = "http")]
20pub(crate) mod osm;
21#[cfg(feature = "http")]
22pub use osm::{OsmTileSource, OSM_TILE_URL};
23
24// wasm_osm uses gloo-net + wasm_bindgen_futures which are themselves
25// gated to `cfg(target_arch = "wasm32")` in Cargo.toml. Mirror that
26// here so a native `cargo check` with the `wasm` feature on (e.g.
27// from a workspace `cargo check --all-features`) doesn't try to
28// compile the module against missing crates.
29#[cfg(all(feature = "wasm", target_arch = "wasm32"))]
30pub(crate) mod wasm_osm;
31#[cfg(all(feature = "wasm", target_arch = "wasm32"))]
32pub use wasm_osm::WasmOsmTileSource;