Skip to content

fix: respect edgeInsets in static mode like a live map#86

Merged
lodev09 merged 3 commits into
mainfrom
feat/static-insets
Jul 8, 2026
Merged

fix: respect edgeInsets in static mode like a live map#86
lodev09 merged 3 commits into
mainfrom
feat/static-insets

Conversation

@lodev09

@lodev09 lodev09 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Static maps (staticMode) ignored edgeInsets - 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.

  • iOS - StaticMapProviderBase bakes 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 matching padding, and the snapshot cache key includes insets.
  • Android - lite mode ignores GoogleMap.setPadding, so the camera target is shifted by the web-mercator equivalent of the inset offset instead.
  • Example - the marker detail screen is now a static map with a translucent info card and edgeInsets bottom matching the card, exercising the fix on both platforms. Detail and static maps list headers are transparent.

Type of Change

  • Bug fix

Test Plan

  • Marker detail screen in the example apps: static map with edgeInsets bottom = card offset + height - the marker should center in the visible area above the card, matching the same screen with staticMode removed.
  • Static maps list: cards without insets are unaffected (offset math is zero).
  • yarn typecheck passes.

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

lodev09 added 3 commits July 8, 2026 06:34
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.
@lodev09 lodev09 merged commit 4aeb796 into main Jul 8, 2026
3 checks passed
@lodev09 lodev09 deleted the feat/static-insets branch July 8, 2026 19:38
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.

1 participant