fix: respect edgeInsets in static mode like a live map#86
Merged
Conversation
iOS shifts the static projection by the same visible-center offset a live map applies, frames the Google warmup view with matching padding, and keys the snapshot cache on insets. Android lite mode ignores map padding, so the camera target is shifted instead.
…o a full map Lite mode renders the map as a single bitmap capped at ~2048px per dimension and centers it, letterboxing bigger views (e.g. full-screen static maps). Map creation now waits for the first layout and uses a full map with all gestures disabled when the view exceeds the cap. Also skip GoogleMap.setPadding in static mode - lite mode does apply padding, shrinking the rendered image on top of the camera-target shift that already compensates for insets.
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.
Summary
Static maps (
staticMode) ignorededgeInsets- the coordinate always rendered at the raw view center. They now shift the visible center exactly like a live map, so the coordinate centers in the inset viewport.StaticMapProviderBasebakes the inset offset into the static projection (snapshot, marker overlays, and drawn shapes stay aligned); insets changing after a render re-renders the base map. The Google warmup map gets matchingpadding, and the snapshot cache key includes insets.GoogleMap.setPadding, so the camera target is shifted by the web-mercator equivalent of the inset offset instead.edgeInsetsbottom matching the card, exercising the fix on both platforms. Detail and static maps list headers are transparent.Type of Change
Test Plan
edgeInsetsbottom = card offset + height - the marker should center in the visible area above the card, matching the same screen withstaticModeremoved.yarn typecheckpasses.Checklist
🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.