Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,24 @@ That is it. Your `<Marker>` children, cluster props, and `react-native-maps` opt
### Bare React Native

```bash
npm install @gmisoftware/react-native-better-clustering react-native-nitro-modules react-native-maps
npm install @gmisoftware/react-native-better-clustering react-native-nitro-modules react-native-maps react-native-reanimated react-native-worklets
cd ios && pod install && cd ..
```

Rebuild the native app after installing.
Rebuild the native app after installing. Add the Worklets Babel plugin (last in the list) to `babel.config.js`:

```js
plugins: ['react-native-worklets/plugin']
```

### Expo

```bash
npx expo install @gmisoftware/react-native-better-clustering react-native-nitro-modules react-native-maps
npx expo install @gmisoftware/react-native-better-clustering react-native-nitro-modules react-native-maps react-native-reanimated react-native-worklets
```

`babel-preset-expo` wires up the Worklets plugin automatically.

Add the `react-native-maps` plugin to `app.json`:

```json
Expand Down
10 changes: 8 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/docs/api/mapview.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ are supported, plus:
| `clusterFontFamily` | — | Font family for cluster count label |
| `animationEnabled` | `true` | Animate cluster changes (iOS only) |
| `layoutAnimationConf` | 200ms easeInEaseOut create/delete + scale update | LayoutAnimation config when `animationEnabled` (tuned for cluster bubble transitions; pass a custom config to override) |
| `clusterFadeInDuration` | `250` | Cross-fade duration (ms) for default cluster bubbles on zoom: new bubbles fade in while removed ones linger and fade out, eliminating the blink from native annotations being added/removed (iOS + Android). Driven by Reanimated on the UI thread. The fade-out cross-fade is applied to the settled cluster set only — during an active pinch/pan, removed bubbles are dropped immediately so a continuous zoom does not stack multiple bubble generations and overload the JS thread. Gated by `animationEnabled`; ignored with a custom `renderCluster`. Set to `0` to disable |
| `tracksViewChanges` | `false` | Forwarded to default cluster markers |
| `edgePadding` | 50px each side | Padding for `fitToCoordinates` on cluster press |
| `preserveClusterPressBehavior` | `false` | Skip auto `fitToCoordinates` on cluster press |
Expand Down
23 changes: 22 additions & 1 deletion docs/docs/setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ npm install react-native-maps
cd ios && pod install
```

### Reanimated (required)

Cluster bubbles fade in on zoom using [Reanimated](https://docs.swmansion.com/react-native-reanimated/),
which runs the animation on the UI thread:

```bash
npm install react-native-reanimated react-native-worklets
cd ios && pod install
```

In **bare React Native**, add the Worklets Babel plugin (must be last) to `babel.config.js`:

```js
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: ['react-native-worklets/plugin'],
}
```

With **Expo**, `babel-preset-expo` adds this plugin automatically — no Babel changes needed.

## New Architecture

This library is a Nitro module and requires React Native's **New Architecture**.
Expand All @@ -29,7 +50,7 @@ Confirm it is enabled and rebuild the native app.
Use a [development build](https://docs.expo.dev/develop/development-builds/introduction/) — not Expo Go.

```bash
npx expo install @gmisoftware/react-native-better-clustering react-native-nitro-modules react-native-maps
npx expo install @gmisoftware/react-native-better-clustering react-native-nitro-modules react-native-maps react-native-reanimated react-native-worklets
```

Add the `react-native-maps` config plugin to `app.json`:
Expand Down
Loading
Loading