Skip to content

fix: frame Apple static base map correctly with edge insets - #98

Merged
lodev09 merged 1 commit into
mainfrom
fix/apple-static-insets
Sep 28, 2026
Merged

lodev09 merged 1 commit into
mainfrom
fix/apple-static-insets

Conversation

@lodev09

@lodev09 lodev09 commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

With nonzero edgeInsets, the Apple static path renders through a temporary MKMapView whose layoutMargins are the insets (to keep attribution inside the viewport). It passed the provider's mapRect, which is already inset-shifted and sized for the whole view, so MKMapView fit it into the margin viewport: base tiles rendered zoomed out and re-centered while markers and shapes projected over the full view. Pass the viewport slice of mapRect instead so the fit puts mapRect over the full view, matching the overlay projection.

Example changes:

  • fittedCamera takes insets: content fits the inset viewport, Apple zoom derives from the full view's short side (insets only shift the center natively)
  • MarkerDetailScreen card bottom follows the safe-area inset via a bottomInset prop from both app wrappers
  • Skill advanced-patterns.md mirrors the helper change

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

  • Bare example on iOS simulator: Static Maps → tap a card → compare Apple vs Google on the detail screen. Pin lands on the same map feature and the constellation line sits on the same tiles for both providers.
  • Static list cards (no insets) unchanged.
  • yarn tsc and eslint pass.

Screenshots / Videos

N/A

Checklist

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

MKMapView fits the visible rect into its layout-margin viewport, so the
inset warmup map rendered zoomed out and off-center from the overlay
projection. Pass the viewport slice of mapRect instead.

Example: fittedCamera takes edge insets and derives the Apple zoom from
the full view; detail card follows the safe-area bottom inset.
@vercel

vercel Bot commented Sep 28, 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 Sep 28, 2026 8:18pm UTC

Request Review

@lodev09
lodev09 merged commit a925ac4 into main Sep 28, 2026
5 checks passed
@lodev09
lodev09 deleted the fix/apple-static-insets branch September 28, 2026 20:18

This branch was successfully deployed

1 active deployment
Preview — 76d14d65 Deployed Sep 28, 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.

1 participant