Commit b3539f0
committed
fix(raster): keep local rasters in saved projects and under layer order
Three desktop-facing raster problems from issue #1463.
Rasters vanish from a reopened project. A local raster reaches the
control as a browser `File`, so nothing on the layer pointed at the file
it came from and restoring a project dropped it. The desktop host now
records the absolute path it read the bytes from
(`metadata.localFilePath`) and re-reads the file on project open through
a host-registered reader; the raster panel's own browse button routes
through the native file dialog so a panel-opened raster carries a path
too. Unchanged in the browser, which has no path: those rasters are
still dropped with a notice.
Rasters obscure the vectors above them. The deck.gl engine draws through
an overlay that, on desktop, is a separate canvas stacked over the map,
so layer order could not reach it. Rasters now default to the
`cog-tiler-wasm` engine, which decodes tiles in WebAssembly and feeds a
native MapLibre raster source/layer, so ordering is the map's own. The
store sync is engine-aware and records the real style layer id.
Trade-off: the WASM tiler renders from its own built-in colormaps, so
"Classify into discrete classes" and custom color ramps -- which work by
patching the deck.gl render pipeline -- do not apply while it is active.
The panel's Rendering engine selector still offers the GPU engine.
A data: URI image fails to load on desktop only. The Tauri CSP allowed
`data:` in `img-src` but not `connect-src`, and MapLibre fetches an image
source's URL rather than assigning it to an `<img>` -- so a KML/KMZ
ground overlay (or a deck.gl icon atlas) died with an opaque "Load
failed". The web CSP already carried `data:` for this reason; the desktop
one now matches.1 parent 691d633 commit b3539f0
8 files changed
Lines changed: 442 additions & 22 deletions
File tree
- apps/geolibre-desktop
- src-tauri
- src
- components/layout
- lib
- docker
- packages/plugins/src
- plugins
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
931 | 935 | | |
932 | 936 | | |
933 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
934 | 953 | | |
935 | 954 | | |
936 | 955 | | |
| |||
1241 | 1260 | | |
1242 | 1261 | | |
1243 | 1262 | | |
1244 | | - | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1245 | 1269 | | |
1246 | 1270 | | |
1247 | 1271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2412 | 2412 | | |
2413 | 2413 | | |
2414 | 2414 | | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
2415 | 2421 | | |
2416 | 2422 | | |
2417 | 2423 | | |
| |||
2439 | 2445 | | |
2440 | 2446 | | |
2441 | 2447 | | |
| 2448 | + | |
2442 | 2449 | | |
2443 | 2450 | | |
2444 | 2451 | | |
2445 | 2452 | | |
2446 | 2453 | | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
2447 | 2496 | | |
2448 | 2497 | | |
2449 | 2498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
87 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
192 | 194 | | |
193 | 195 | | |
| 196 | + | |
| 197 | + | |
194 | 198 | | |
| 199 | + | |
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
| |||
0 commit comments