Repository navigation
Basemaps: stack web basemaps and blend tile layers - #427
Conversation
Tile layers take a blend mode (Normal, Multiply, Screen, Overlay, Darken, Lighten, Difference), set with map.addTiles/map.setTiles and saved with the project. The renderer draws a blended tile layer on a layer of its own and composites it with that mode, on the flat map and in the mosaic warped onto the globe and other projections. The Layers pane's tile layer menu picks the mode, and the Basemap gallery's Web Basemaps can stack on the current basemaps instead of replacing them. Fixes #329
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code reviewThe change is small and consistent: a per-tile-layer Bugs
Performance
Quality
Security
AGENTS.md
Change sizeCompared: the whole PR against main (merge base c60bbfe to PR head fcd1d69).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
- render: blended tile layers share one scratch pixmap per draw instead of allocating a zeroed full-size pixmap for each, and a failed allocation (falling back to Normal blending) is logged. - ribbon: when stacking web basemaps, clicking a basemap already shown removes it instead of re-adding it, which reset its blend mode, opacity and position.
Code reviewThis PR adds a per-layer Bugs
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base c60bbfe to PR head a036add).
|
The Basemap gallery's Stack tooltip and the user guide now say that clicking a web basemap that already shows removes it when stacking.
|
I'll fold that into the summary instead. Code reviewBlending tile layers is small and well-contained. I found no bugs. I read the diff and the surrounding Bugs
Quality
Security
Performance
AGENTS.md
Change sizeCompared: the whole PR against main (merge base c60bbfe to PR head 289d79d).
|
Web tile layers could only be drawn plainly over each other, and the Basemap gallery's Web Basemaps always replaced the current basemap (
replace: true), so a satellite image could not be draped over a hillshade.Changes
TileLayergainsblend(the sameBlendmodes layers already have: Normal, Multiply, Screen, Overlay, Darken, Lighten, Difference). It is saved with the project, and only when it isn't Normal, so existing projects are unchanged.map.addTilesandmap.setTilestake"blend", andmap.tileslists it. An unknown mode is an error. Changes can be undone.docs/user-guide/maps.mdand themap.addTilesrow indocs/plugins.mdare updated.The external Basemaps plugin (opengeos/rustgis-plugins) can now stack by sending
replace: falseand set a blend mode withblend. That change belongs in that repo.Tests
render::tiles::tests::blends_tile_layers_with_those_beneath: a style tile layer set to Multiply over red raster tiles draws red × blue instead of blue, Screen draws lighter than either layer, and Multiply also holds on the globe.engine::cmd::tiles::tests::stacks_basemaps_and_blends_them: stacks two basemaps withoutreplace, sets the blend throughmap.addTilesandmap.setTiles(and undoes it), rejects unknown modes and round-trips the project.Verification
cargo xtask ciandcargo build --target wasm32-unknown-unknown -p rustgis-webpass locally.ui_shotwith real tiles over the Grand Canyon: Esri World Hillshade under USGS Imagery. With the imagery set to Multiply, the hillshade's shadows and ridges show through the orthophoto. Switching it back to Normal shows the plain imagery. The Layers pane menu shows Blend: Multiply and the mode list in both the light and dark themes. The Basemap gallery shows the new Stack on the current basemaps checkbox above the Web Basemaps.Fixes #329