Skip to content

fix(engine, map): a map package's map file requires what it draws, and an image's dots show in a feature of no fill (#2266) - #2300

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/2266-map-package-requires
Nov 16, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/2266-map-package-requires

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A follow-up to #2278 (#2266 part A1), from CodeRabbit's last review there, which came after the merge.

  • A map package's map file declares what it needs. map.package (map and mobile packages) wrote its .rgismap without the header the map file writer gives, so requires was missing, and an older RustGIS had nothing to refuse it by. It now writes through map_file_bytes, as map.save does, so every capability a map needs (picture-markers, terrain, shaded relief, …) is declared there too.
  • An image's dots show in a feature of no fill. FillLayer::draws counts a dot fill whose marker is an image as drawn whatever the fill colour, as Symbol::draws does for a point's image, so its legend row isn't dropped.

Left for later, as said on #2278:

  • A mark read from a file that is an image can't be edited (layer.lineStrokes refuses "mark": "image", and the Marks pane drops the error): part of A2, which sets images in marks.
  • In a tilted view, an upright image is culled by its anchor rather than its reach, and isn't tinted by the fog: a follow-up.

Testing

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings
  • cargo nextest run --workspace without the DuckDB tests, which fail on this machine for reasons unrelated to this change: 7394 passed; hostile_params_never_panic, doc tests, cargo xtask layers, cargo xtask schema --check, cargo check -p rustgis-web --target wasm32-unknown-unknown
  • After rebasing on main: clippy, and the engine and map tests (2314 passed)
  • an_image_is_a_marker_kept_in_the_project_file_that_an_older_reader_refuses (engine) now packages the map, as a map and a mobile package, and reads requires: ["picture-markers"] from the map file inside.
  • picture_markers_keep_their_image_once_and_bound_what_a_file_gives (map) checks that an image's dots draw in a feature of no fill, and a circle's or no image's don't.

UI evidence

No visible UI change.

Related issue

Part of #2266. Follows #2278.

Summary by CodeRabbit

  • Bug Fixes
    • Image-based markers in dot patterns now display when their size is positive, even if the fill and outline are transparent. Circle markers and default image markers remain unaffected.
    • Map packages now retain the requirement for picture markers, including packages created for mobile use. This helps ensure maps using picture markers are identified correctly when packaged.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Map packages now use map_file_bytes for archived .rgismap contents, and package tests check the picture-markers requirement. Dot fills now treat non-default picture markers with positive size as drawable, even when fill and outline are transparent.

Changes: Map package metadata

Layer / File(s) Summary
Serialize map package metadata
crates/engine/src/cmd/items.rs, crates/engine/src/tests.rs
package_map uses map_file_bytes for the archived .rgismap contents. Tests check that standard and mobile packages declare requires: ["picture-markers"].

Picture markers in dot fills

Layer / File(s) Summary
Determine dot-fill visibility
crates/map/src/fills.rs, crates/map/src/symbology.rs
FillLayer::draws treats non-default picture markers with positive size as drawable regardless of fill color. Tests check picture, circle, and default picture markers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

  • opengeos/RustGIS#2278: This PR adds picture markers and saved-file compatibility metadata used by the changes here.

Suggested reviewers: pick2510, mavrick-f, giswqs

Merge Risk: Minimal · up to 2c6e9

Map and mobile packages now declare their required capabilities, so older readers refuse files they cannot preserve. Image-dot fills with no fill color stay visible. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names two changes: map packages now declare the capabilities their map file requires, and image dots draw in a feature with no fill. Both match the raw summary (items.rs now uses map_file_by…
Description check Passed The description follows the repository template. It has Summary, Testing, UI evidence, and Related issue sections. The UI evidence section states 'No visible UI change.', which the template allows whe…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names two changes: map packages now declare the capabilities their map file requires, and image dots draw in a feature with no fill. Both match the raw summary (items.rs now uses map_file_bytes; fills.rs treats a non-default Marker::Picture dot fill as drawable when its size is positive, and tests were added). The title is specific and long, but it covers the main changes. The fix(engine, map) prefix follows conventional commit style.

Full details: Description check

Explanation

The description follows the repository template. It has Summary, Testing, UI evidence, and Related issue sections. The UI evidence section states 'No visible UI change.', which the template allows when there is no visible change. The Summary explains the two changes and the reason for each. The Testing section lists commands and the new tests. The Related issue section says 'Part of #2266. Follows #2278.' The description does not explain the template's 'Closes' convention, but it links the related issue as the template requests.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

A rabbit packs a map with care
Picture dots appear in there
The markers show through colors clear
A capability note travels near
Hop, the map is ready to share!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6d8546bc-e46e-4d4f-8f52-8bebdd06fbe6
Commits

Reviewing files that changed from the base of the PR and between 6205caa and 2c6e993.

Files selected for processing: 4

  • crates/engine/src/cmd/items.rs
  • crates/engine/src/tests.rs
  • crates/map/src/fills.rs
  • crates/map/src/symbology.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment thread crates/map/src/fills.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. I checked the new map.package path against map_file_bytes, output_owned, and the import path. The package now writes the same format and requires header that map.save already writes, and import_maps runs check_format on it. The FillLayer::draws change matches the Symbol::draws precedent, and the renderer draws image markers regardless of fill colour, so the predicate matches what gets drawn. tint is unaffected: a transparent fill colour contributes nothing there. Map-level requires covers every picture source a map can hold, including hidden fills.

Security: None found. No new input parsing, and no new file or network access.

Performance: None found. The change adds one matches! check per dot fill.

Quality:

  • The image test in fills.rs duplicates the Symbol::draws predicate. This is a nit; it is left for the release quality pass.
  • The new map.package assertions in tests.rs write into a shared temp directory without cleanup. This is the existing pattern in that test, so I did not flag it.

AGENTS.md:

  • The PR says "No visible UI change", but the draws change paints image dots in no-fill features on the map. I posted one inline comment on crates/map/src/fills.rs:391. AGENTS.md asks for before/after screenshots for visible changes and a list of the surfaces the change reaches.
  • The schema needs no update: schema/ covers projects only, not map files.

Already raised: 0 earlier concerns, since there are no prior review threads on this PR.

Change size

Compared with main: the whole PR, merge base 6205caa to PR head 2c6e993.

Measure Value
Files changed 4 (added 0, modified 4, removed 0, renamed 0)
Size before 3.35 MB
Size after 3.35 MB
Total size change +998 B
Path Before After Change
crates/engine/src/tests.rs 3.01 MB 3.01 MB +563 B
crates/map/src/symbology.rs 231.6 KB 231.8 KB +225 B
crates/map/src/fills.rs 22.5 KB 22.7 KB +172 B
crates/engine/src/cmd/items.rs 93.2 KB 93.2 KB +38 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2300/
Web app https://preview.rustgis.app/pr-2300/app/
Commit 2c6e993

GitHub Pages takes a minute or two to publish a new commit.

@jgregoriorincon
jgregoriorincon marked this pull request as ready for review November 16, 2026 20:35
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I found no blocking bugs or security issues. The change is small (4 files, about 20 changed lines). I checked the signatures it depends on, the render paths that consume FillLayer::draws, and the new test against its helpers. I could not build or run the tests in this environment.

Bugs: none found.

  • map_file_bytes(&Map) matches the FnOnce(&T) that durable::output_owned takes. Marker is Copy, so matching marker through &self in fills.rs:391 compiles.
  • requires is computed after mobile_map and the simplification, so a hidden or dropped picture layer doesn't declare a capability it no longer draws.
  • The render path matches the new draws rule. draw_marker (render/src/lib.rs:1994) draws a picture regardless of fill colour, and unit_paint and pattern_fill both gate on f.draws.
  • Low confidence (about 35%): FillLayer::draws checks only Picture::is_default, so an image that is set but undecodable now keeps its legend and fill-editor row while drawing nothing. Symbol::draws already behaves this way for points, so this is consistent with existing behaviour, not a regression.

Security: none found. No new input parsing or file handling; the package path reuses the existing serializer.

Performance: no concern. Features with no fill and image dots now go through the existing tile cache, and the cost is bounded by the same dot count.

Quality (for the release quality pass):

  • The doc comment on FillLayer::draws (crates/map/src/fills.rs:382-383) still says it covers only a colour and lines or markers of some size. It should mention an image.
  • The new fill assertions (symbology.rs:3612-3613) don't cover an image dot of size 0, which is the size > 0.0 gate the new image || sits inside. Symbol::draws has that case covered.

AGENTS.md: no violations found.

  • No unwrap in non-test code; the new test uses unwrap, as the surrounding test does.
  • No platform-specific code, so the wasm build is unaffected.
  • A map package is not a project save, so cargo xtask schema and the schema file don't need regenerating.
  • No new command, tool or export, so the cancel lists don't change.

I posted no inline comments: the findings are minor or quality-pass items. I left 1 earlier concern alone because it was already raised: the unresolved thread on fills.rs:391 asking for before/after screenshots and a surfaces statement, since the PR body still says "No visible UI change".

Change size

Compared with main (merge base 6205caa to PR head 2c6e993).

Measure Value
Files changed 4 (0 added, 4 modified, 0 removed, 0 renamed)
Size before 3.35 MB
Size after 3.35 MB
Total size change +998 B
Path Before After Change
crates/engine/src/tests.rs 3.01 MB 3.01 MB +563 B
crates/map/src/symbology.rs 231.6 KB 231.8 KB +225 B
crates/map/src/fills.rs 22.5 KB 22.7 KB +172 B
crates/engine/src/cmd/items.rs 93.2 KB 93.3 KB +38 B

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 16, 2026
Merged via the queue into opengeos:main with commit dde3e20 Nov 16, 2026
25 checks passed
@jgregoriorincon
jgregoriorincon deleted the fix/2266-map-package-requires branch November 16, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant