Skip to content

[Bug]: Changing a tile layer's opacity doesn't fade its icons #1358

Closed

Description

@deniial00

Before you start

  • I searched the existing issues and did not find a duplicate.
  • This is a bug report, not a usage question (questions belong in Discussions).

What happened?

Changing the opacity of a tile layer that is a MapLibre style does not change its icons. Its fills and lines fade, but the icons of its symbol layers stay at full strength.

Found while reviewing #1294, which makes Seamap's icons draw. It doesn't look caused by #1294: no line of its diff deals with opacity, and by reading the code, icons from a style's one sprite took the same path before.

From reading the code (not yet confirmed by a run): fills and lines are drawn into the layer's picture, which is composited at the layer's opacity (crates/tiles/src/draw.rs, draw). Symbol layers are not drawn into it. They are collected as labels (symbols::collect into Drawn.labels) and turned into PlacedLabel/PlacedIcon in crates/render/src/tiles.rs (collect, tile_label). Neither function receives the layer's opacity, and PlacedIcon (crates/render/src/lib.rs) has no alpha, so the map's label pass draws them at full strength. The label text probably does the same.

Steps to reproduce

  1. Add a MapLibre style whose symbol layers draw icons with Home › Add › Basemap › Add Tile Layer…, for example Open Waters' Seamap: https://tiles.openwaters.io/seamap/style.json. On main the Open Waters map isn't drawn in the web app, so use the PR preview of feat(tiles): read every sprite of a style, and the image expression #1294.
  2. Zoom to where icons show, for example Hoek van Holland (4.08, 51.985) at 1:40,000.
  3. Lower the layer's opacity (map.setTiles with "opacity", or the layer's opacity in the Layers pane).
  4. Compare the icons with the fills and lines.

Confirmed in the web app on macOS (Brave 1.98.62), with the PR preview of #1294.

Expected behavior

A tile layer's opacity applies to everything it draws: the icons (and text) of its symbol layers fade along with its fills and lines.

How are you running RustGIS?

Web app (https://web.rustgis.app), with the PR preview of #1294.

Version

The PR preview of #1294 (web app).

Operating system, browser and graphics

macOS, Brave 1.98.62.

Sample data

Open Waters' Seamap style, https://tiles.openwaters.io/seamap/style.json.

Screenshots or logs

None.

Activity

  1. ninhhaidang commented on Nov 3, 2026

    @ninhhaidang
    Member

    I'm taking this one. My reading of the code matches the report: fills and lines are composited at the layer's opacity, while symbol layers are placed as labels and icons and never receive it. I've reproduced it with a local style (fill, line, icons and text) and have a fix ready; a pull request follows shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions