feat: initial @capgo/capacitor-native-map (Google Maps + MapKit + web)

RI
1d ago
+19489-1

Merge readiness (HEAD 626fc46)

README screenshots

AssetStatus
assets/readme-screenshot-ios.webpUpdated from native simulator capture (MapKit + overlay HUD), 280px wide
assets/readme-screenshot-android.webpNot updated (see Android key below)

Screenshot workflow: .github/workflows/readme-screenshots.yml (workflow_dispatch only). Successful capture run: 36913948764.

GOOGLE_MAPS_API_KEY secret

Workflow artifact maps-key-status.txt from run 36913948764 reports google_maps_api_key_present=false. The Android emulator screenshot from that run is a blank white screen (no map tiles). Do not use it for the README.

gh secret list returned HTTP 403 from this agent (cannot enumerate secrets directly). Treat the workflow status file as the source of truth: add GOOGLE_MAPS_API_KEY on the repo, re-run Capture README screenshots on this branch, then replace assets/readme-screenshot-android.webp from the readme-screenshot-android artifact (280px webp).

CI (latest test run on 626fc46)

Run 36915354954: guard_swiftpm_version, Build code and test, build_ios, build_android all success.

Review

Unresolved GraphQL review threads: 0

Hold merge for Martin sign-off before npm release on main tag.

Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Initial release of @capgo/capacitor-native-map: one JavaScript API backed by Google Maps on Android, Apple MapKit on iOS, and the Google Maps JavaScript API on web. Adds a toBack overlay mode that renders the native map behind a transparent WebView.

Setup

  • Android and web need a Google Maps API key passed to NativeMap.create({ apiKey }); iOS uses MapKit and needs none.
  • Merging to main triggers the version-bump and npm publish workflows, releasing 8.0.0 — hold the merge until Martin signs off.
  • The README Android screenshot is blank until the GOOGLE_MAPS_API_KEY secret is added to the repo; replace it from a fresh screenshot workflow run.

Includes

  • Marker, camera, overlay, clustering, events, enableCurrentLocation, and fitBounds support through the NativeMap wrapper.
  • toBack handles multi-touch routing, hidden-map hit tests, WebView compositing, and parent background restore on Android; touch passthrough, z-order selection, updateLayout, show, hide, and mount preservation on iOS; a dedicated positioned map host element on web.
  • create cleans up on failure, respects forceCreate, tracks the active map registry lifecycle, avoids mutating caller options, and applies measured bounds only; duplicate create() calls still fire the ready callback, and ready-callback errors are reported while destroyed maps are guarded in onMapReady; superseded takeSnapshot requests reject instead of hanging.
  • Example app with an overlay demo, CI that captures README screenshots, and a README-only MIT credit for the ported sources.

Summary by CodeRabbit

  • New Features
    • Added a cross-platform maps plugin for iOS, Android, and web, with camera and bounds controls, markers, shapes, clustering, location features, and map events.
    • Added place search, geocoding, and map snapshots on iOS, plus marker callouts, map appearance settings, and user-tracking controls.
    • Added typed interfaces for creating maps, managing overlays, and listening for events.
    • Added improved touch routing and support for displaying maps behind app content.
  • Chores
    • Added checks for deprecated platform APIs and plugin wiring.