mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
478 stars 134 forks source link

[Compose] Cannot add several SymbolLayers at the same locations #2400

Open JulienNevo opened 5 months ago

JulienNevo commented 5 months ago

Environment

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.

pengdev commented 5 months ago

Hey @JulienNevo can you try with setting iconAllowOverlap and iconIgnorePlacement to true?

JulienNevo commented 5 months ago

Thanks for your answer. Yes, iconIgnorePlacement works rather fine, but the problem is that zooming out will not remove the symbols of a layer when they overlap between them. So I get a very messy group of the symbols...