Skip to content

fix(maps): Insert tile overlays below annotations and handle zIndex - #345

Merged
LisoUseInAIKyrios merged 2 commits into
MorpheApp:devfrom
Akash-Sriram:fix/maps-tileoverlay-zindex
Nov 4, 2026
Merged

LisoUseInAIKyrios merged 2 commits into
MorpheApp:devfrom
Akash-Sriram:fix/maps-tileoverlay-zindex

Conversation

@Akash-Sriram

@Akash-Sriram Akash-Sriram commented Nov 4, 2026 •

Copy link
Copy Markdown

Fixes #344

Currently TileOverlayImpl appends raster layers to the top of the Mapbox style stack with style.addLayer(), ignoring zIndex completely. In apps like Google Photos (the "Explore / Places" photo heatmap view), the tile overlays end up rendering on top of photo markers and pin labels instead of underneath them.

Changes:

  • In TileOverlay.kt: use style.addLayerBelow() targeting the lowest active annotation layer (fillManager, lineManager, or symbolManager), falling back to style.addLayer() if no annotations exist yet.
  • In GoogleMap.kt: add reorderTileOverlays() to sort active overlays by zIndex beneath annotation layers. Call it when adding overlays, changing zIndex, clearing the tile cache, or when styles reload.
  • Remove active tileOverlays in GoogleMapImpl.clear().

Tested on a POCO F1 running Android 15 with Google Photos.

@Akash-Sriram Akash-Sriram changed the title fix(maps): Ensure TileOverlay respects Z-index and renders below annotations fix(maps): Insert tile overlays below annotations and handle zIndex Nov 4, 2026
@LisoUseInAIKyrios LisoUseInAIKyrios linked an issue Nov 4, 2026 that may be closed by this pull request
2 tasks done
@LisoUseInAIKyrios
LisoUseInAIKyrios merged commit 78634e9 into MorpheApp:dev Nov 4, 2026
2 checks passed
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.

bug: Tile overlays render on top of markers and labels

2 participants