Index of every page on this site: llms.txt
All skills
gmi-software avatar

/react-native-better-maps

@443959a
Run it yourself

Expert guide to react-native-better-maps — native maps for React Native built on Nitro Modules, with Apple MapKit and Google Maps provider adapters, descriptor-based overlays, and native marker clustering. Use when installing or configuring the map, rendering markers or overlays, driving the camera, diagnosing lag or marker re-render churn, working around a provider or platform difference, migrating from react-native-maps, or changing the library's TypeScript, Swift, Kotlin, or Nitro specs.

  • 12 files
  • 140.2 KB
  • MIT
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/gmi-software/better-skills/react-native-better-maps

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

react-native-better-maps

Native map view for React Native's New Architecture. One Nitro HybridView (MapView) backed by Apple MapKit or Google Maps. Overlays are serialisable descriptors (not child views). Clustering is implemented in Swift/Kotlin — not JavaScript, not shared C++, and not shared with react-native-better-clustering (load that skill only when clustering on react-native-maps).

Paths like package/src/... are relative to a library checkout, not this skills repo.

Version verification

Package:            react-native-better-maps
Version:            1.1.0
Commit:             b9a178334913043b3aa2542fb528731debaad4f5
Verification date:  2026-08-21
npm view react-native-better-maps version
node -p "require('react-native-better-maps/package.json').version"

When to use

  • Installing / configuring the map (Google keys, Expo config plugin)
  • Markers, polylines, polygons, circles, camera control
  • Jank, flicker, markers disappearing at some zooms
  • iOS vs Android or Apple vs Google behaviour differences
  • Migrating from react-native-maps
  • Changing TypeScript, Swift, Kotlin, Nitro specs, or the config plugin

When NOT to use

Situation Instead
Using or debugging react-native-maps itself (not migrating) Load the react-native-maps skill
Clustering on top of react-native-maps Load the react-native-better-clustering skill
Mapbox / OSM tiles Names exist in MapProvider but throw at runtime
Arbitrary React views as marker content Unsupported on every provider
Web / Old Architecture / Expo Go Native New Arch + development build only
Directions / geocoding / places Outside this library

Core architecture

  1. One HybridView. Everything is a prop or imperative method on MapView.
  2. Overlays are descriptors. <Marker> renders null; props become MarkerDescriptors. Bulk markers bypasses child collection — preferred for large sets.
  3. Adapters own SDKs. MapProviderAdapter owns MapKit or Google Maps.
  4. Provider changes remount. Key is `${provider}:${googleMapId ?? ''}` — camera and overlays must be re-supplied.
  5. Large sets take a background path. Clustering on, or >500 descriptors → spatial index on a background queue; smaller unclustered sets apply synchronously.
  6. No shared native package. Native changes require both Swift and Kotlin (or an explicit provider/platform carve-out).

API guidance

import {
  MapView, Marker, Polyline, Polygon, Circle,
  regionFromCoordinate, distanceBetween,
} from 'react-native-better-maps';

That is the entire runtime surface (plus types). Full detail: api.md.

Problem → reference routing

Problem Start here
Installation / blank map / Expo setup.md
Google Maps blank/crash on iOS setup → ios.md
Markers, overlays, camera api.md
Lag while panning/zooming performance.md
Marker re-render / flicker rendering.md
Clustering / markers vanish when zoomed out clustering.md
Provider / platform asymmetry ios.md, android.md
Camera fights controlled region debugging.md
Migration from react-native-maps migration.md
animateCamera hangs debugging — duration is seconds, not ms
Architecture / contributing architecture.md, contributing.md

Canonical performance workflow

  1. Baseline (release, real device, recorded number)
  2. Define workload (count, provider, gesture)
  3. Profile (Instruments / Android Studio Profiler)
  4. Identify layer (JS / React / JSI conversion / native SDK)
  5. Hypothesis → smallest change → re-measure → compare → regression note

Most "slow map" reports are layer 1: camera event → parent re-render → new markers array → full descriptor re-cross. Region callbacks fire once per gesture, not per frame.

Common mistakes

  • Passing duration: 300 to animateCamera (five-minute animation — unit is seconds)
  • Expecting custom React marker views
  • Using openstreetmap / mapbox provider values (they throw)
  • Assuming Google-iOS honours image / anchor / opacity (it forces stock pins)
  • Blaming clustering first when the parent rebuilds descriptors every camera event
  • Measuring FPS on emulator / debug builds

Troubleshooting

  1. Blank/grey map → keys + Expo plugin + New Arch (setup.md)
  2. Slow → name the layer (performance.md)
  3. Flicker → stabilize markers / descriptor identity (rendering.md)
  4. Crash / odd prop → debugging.md

Known limitations (high signal)

Limitation Consequence
openstreetmap / mapbox unimplemented Throw during render
Google-iOS ignores marker visuals Stock pins only; no warning
animateCamera duration in seconds Default 0.25 s
Android fitToCoordinates / region apply collapse padding to max edge Asymmetric fit padding does not port; mapPadding is per-edge
Unclustered LOD drops markers when zoomed out By design, not a bug
No Expo Go Development build required
No benchmark harness in repo Measure yourself

Full list and evidence rules: see references; do not invent thresholds.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 443959a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 3 months ago
Other metadata
metadata
{
  "package": "react-native-better-maps",
  "version": "1.1.0",
  "commit": "b9a178334913043b3aa2542fb528731debaad4f5",
  "verified": "2026-08-21",
  "repository": "https://github.com/gmi-software/react-native-better-maps",
  "audience": "library users and library contributors",
  "tags": "react-native, maps, mapkit, google-maps, nitro, jsi, markers, clustering, expo, ios, android"
}

README badge

README badge for gmi-software/better-skills/react-native-better-maps