mapbox / mapbox/mapbox-maps-android

[Compose] Cannot add several SymbolLayers at the same locations

Open
#2,400 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle: compose feature :green_apple:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

Environment

  • Android OS version: 11.0
  • Devices affected: Xiaomi MI 11 and emulators
  • Maps SDK Version: 11.4.0

Observed behavior and steps to reproduce

Adding two SymbolLayer with icon/and images will not stack up, items of one or another layer being chosen seemingly randomly.

SymbolLayer(
        layerId = "layer1",
        sourceState = displayedItems,
        iconImage = IconImage("mb_image1"),
        iconAnchor = IconAnchor.BOTTOM,
)
SymbolLayer(
        layerId = "layer2",
        sourceState = displayedItems,
        iconImage = IconImage("mb_image2"),
        iconAnchor = IconAnchor.CENTER,
)

I would like to show (or not) parts of items according to business rules, but I cannot currently do that, as it seems items located at the same locations are visually exclusive.

Expected behavior

All items at one location should show.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on Android 11 with the two SymbolLayer definitions and shared displayedItems source shown in the report. Investigate how Compose SymbolLayer placement handles coincident icons; done means both layers' items render at the same location rather than one being selected randomly.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.