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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
[]
= "slint-mapping"
= "0.1.0"
= "2021"
= "1.74"
= "MIT OR Apache-2.0"
= "Map framework for Slint — interactive map component with tile rendering, panning, zooming, and marker overlays."
= "https://github.com/gregoryraymond/slint-mapping"
= "https://gregoryraymond.github.io/slint-mapping/"
= "https://docs.rs/slint-mapping"
= "README.md"
= ["slint", "map", "tiles", "osm", "geo"]
= ["gui", "graphics", "rendering"]
# Stays false until you're actually ready to ship. `just publish-dry`
# temporarily flips it for the dry-run; the real `cargo publish` needs
# it set to `true` (or removed — `true` is the default).
= true
# Single-package workspace so the wasm-demo crate can live alongside
# the library and consume it via `path = ".."`. Root crate stays the
# library; sub-crates are demos / examples that aren't part of the
# published API.
[]
= ["wasm-demo", "crates/slint-android-gestures"]
[]
= ["rlib"]
[]
= { = "1", = false, = [
"compat-1-2",
"std",
] }
# Synchronous HTTP client used by OsmTileSource + prefetch::region for
# fetching raster tiles. Gated behind the `http` feature so consumers
# who only want offline tile bundles don't pull rustls in.
= { = "2", = false, = ["tls"], = true }
# Off-thread PNG decoding. Used by OsmTileSource's worker so the UI
# thread never decodes — only wraps an already-decoded
# SharedPixelBuffer via slint::Image::from_rgba8. PNG-only for now to
# keep the dep small.
= { = "0.25", = false, = ["png"], = true }
# JSON deserialisation for OsrmRouter responses. Gated behind the
# `routing` feature so consumers who only want tile rendering don't
# pull serde derive machinery.
= { = "1", = ["derive"], = true }
= { = "1", = true }
# wasm-only dependencies — pulled in by the `wasm` feature, which
# enables WasmOsmTileSource (browser-side OSM source). Kept under a
# target-cfg block so a `cargo check` on a native target with `wasm`
# in scope (e.g. cargo metadata in tooling) doesn't try to download
# them. The actual feature gate is in [features] below.
[]
= { = "0.2", = true }
= { = "0.3", = true }
# web-sys with the exact API surface our fetch path needs. Replaces
# gloo-net 0.5 — the gloo wrapper was hitting the "FnOnce called
# more than once" + index-out-of-bounds cascade in `js-sys`'s
# JsFuture under Firefox (its Promise→then handler chain was
# triggering closure double-invocation). web-sys's fetch is the
# same Promise but with one less layer of indirection; less surface
# area for the bug to surface across.
= { = "0.3", = true, = [
"Window",
"XmlHttpRequest",
"XmlHttpRequestEventTarget",
"XmlHttpRequestResponseType",
] }
# Bounded LRU for the in-browser tile cache. Without it,
# WasmOsmTileSource's HashMap grows forever — each 256x256 RGBA tile
# is 256 KB, and a few minutes of panning leaks hundreds of MB and
# eventually freezes the tab. lru is a tiny dep (~6 KB compiled) with
# no transitive cost.
= { = "0.16", = true }
# Lets us store a `!Send` closure (e.g. one that captures `Rc<…>`) in
# a struct that needs to satisfy `Send + Sync` for the TileSource
# trait. SendWrapper is safe on single-threaded wasm because every
# access happens on the same JS thread; it panics if dereferenced
# from anywhere else, which on wasm32-unknown-unknown can't happen.
= { = "0.6", = true }
[]
= "1"
[]
# Drives MapView from Rust tests without a real backend / event loop.
= "1"
[]
# Pulls in Slint's default desktop backend + Skia renderer so the
# `viewer` example can open a real window. Off by default so consumers
# (e.g. an Android app) don't have winit forced on them.
= ["slint/backend-default", "slint/renderer-skia"]
# Enables OsmTileSource + prefetch::region (HTTP fetching via ureq).
# Pulls `image` too because OsmTileSource decodes PNG bytes off the
# UI thread into a SharedPixelBuffer for non-blocking refreshes.
= ["dep:ureq", "dep:image"]
# Enables OsrmRouter and the routing types. Shares ureq with the
# `http` feature but adds serde for parsing OSRM's GeoJSON responses;
# kept as a separate feature so a consumer that only wants tile
# rendering doesn't pull serde derive into their build.
= ["dep:ureq", "dep:serde", "dep:serde_json"]
# Enables WasmOsmTileSource — a browser-side OSM tile source that
# uses web-sys's XmlHttpRequest + a Closure::once_into_js callback
# instead of ureq + std::thread (or fetch + spawn_local, which an
# earlier iteration tried but hit a fatal JsFuture × winit-web
# closure-reentrancy bug — see crates/slint-mapping/src/sources/
# wasm_osm.rs for the post-mortem). Off by default; the mobile
# (Android) target never wants any of this. Mutually exclusive in
# practice with `http` (ureq doesn't compile to
# wasm32-unknown-unknown), but they don't conflict at the Cargo level
# — leaving both on a wasm build just brings in the dead native code
# in `osm.rs`.
#
# Every dependency this pulls is additionally gated by
# `[target.'cfg(target_arch = "wasm32")']` in this Cargo.toml, plus
# `#[cfg(all(feature = "wasm", target_arch = "wasm32"))]` on
# `src/sources/wasm_osm.rs`. Triple-gated: a native cargo build with
# `--features wasm` accidentally on still pulls zero wasm crates.
= ["dep:wasm-bindgen", "dep:js-sys", "dep:web-sys", "dep:send_wrapper", "dep:image", "dep:lru"]
[[]]
= "viewer"
= ["viewer"]
[[]]
= "map_page"
= ["viewer"]
[[]]
= "slint-mapping-prefetch"
= "src/bin/prefetch.rs"
= ["http"]