Repository navigation
fix(ios): restore marker icons dropped before the first map render - #113
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
lodev09
approved these changes
Nov 13, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
markerViewDidUpdatesees a new anchor, scale orrasterize, or whenmarkerViewDidLayoutruns again. A static marker never gets its icon back. The vehicle marker showed because it gets restyled later.GoogleMapProvidernow implementsmapViewDidFinishTileRendering:. The first time each map finishes rendering its tiles, it callsapplyMarkerStylefor 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.