Skip to content

fix(ios): restore marker icons dropped before the first map render - #113

Merged
lodev09 merged 1 commit into
mainfrom
eric/ios-early-marker-icons
Nov 13, 2026
Merged

lodev09 merged 1 commit into
mainfrom
eric/ios-early-marker-icons

Conversation

@erickreutz

Copy link
Copy Markdown
Member

On iOS with Google Maps, custom markers can come up without icons when a screen with markers is the first thing an app shows after a cold start. The markers sit at the right coordinates, but nothing draws. The same screen opened later in the session draws them. We hit it in the Lugg consumer app: a cold launch from a tracking link drew the route and the vehicle, but none of the stop pins.

The Google Maps SDK drops a marker icon that is set before any map in the process has finished its first render. In our app, the link opens a full-screen modal with a map over a screen that has its own map. That screen's map starts rendering but goes off-window before it finishes. The modal's markers are added right after their map is created, with real rasterized icons, before any map has rendered. After that, a marker is restyled only when markerViewDidUpdate sees a new anchor, scale or rasterize, or when markerViewDidLayout runs again. A static marker never gets its icon back. The vehicle marker showed because it gets restyled later.

GoogleMapProvider now implements mapViewDidFinishTileRendering:. The first time each map finishes rendering its tiles, it calls applyMarkerStyle for every marker in _markerToViewMap, which re-rasterizes custom icons. Later renders skip it. Markers added after the first render don't need it, since by then a map has rendered.

Reproduced on an iPhone with a cold launch straight into that screen. Before this change, 0 of 4 launches drew the pins. With it, 4 of 4 did. Opening the screen from a running app still draws them, and so do markers on the app's first map after a cold start. Android was not checked. There is no automated test, because the failure depends on the SDK's startup timing on a device.

The Google Maps SDK drops a marker icon that is set before any map in
the process has finished its first render. A cold start straight into a
screen with custom markers hits this: the markers are added at the right
coordinates with real rasterized icons, but nothing draws. A marker is
restyled only when its anchor, scale or rasterize changes, or when it
lays out again, so a static marker never gets its icon back.

Re-apply every marker's style the first time each map finishes rendering
its tiles.
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lugg-maps Ready Ready Preview Nov 12, 2026 8:55pm UTC

Request Review

@lodev09
lodev09 merged commit 1dec1c1 into main Nov 13, 2026
5 checks passed
@lodev09
lodev09 deleted the eric/ios-early-marker-icons branch November 13, 2026 06:37

This branch was successfully deployed

1 active deployment
Preview — acfc2b17 Deployed Nov 12, 2026 by vercel[bot]
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.

2 participants