Skip to content

Commit 601f796

Browse files
committed
Initial release of react-native-nitro-maps monorepo.
0 parents  commit 601f796

142 files changed

Lines changed: 10229 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v2
18+
with:
19+
bun-version: latest
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
26+
- name: Install dependencies
27+
run: bun install --frozen-lockfile
28+
29+
- name: Lint
30+
run: bun run lint
31+
32+
- name: Typecheck
33+
run: bun run typecheck
34+
35+
- name: Build
36+
run: bun run build

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
node_modules/
2+
lib/
3+
dist/
4+
*.log
5+
.DS_Store
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Build outputs
11+
package/lib/
12+
package/nitrogen/
13+
14+
# Expo
15+
example/.expo/
16+
example/dist/
17+
example/web-build/
18+
19+
# Native — Android (any module: package/, example/, etc.)
20+
.cxx/
21+
.gradle/
22+
local.properties
23+
*.iml
24+
**/android/build/
25+
**/android/app/build/
26+
*.hprof
27+
28+
# Native — iOS
29+
*.xcuserstate
30+
*.xcworkspace
31+
!*.xcworkspace/contents.xcworkspacedata
32+
*.xcodeproj
33+
!*.xcodeproj/project.pbxproj
34+
!*.xcodeproj/xcshareddata/
35+
!*.xcodeproj/project.xcworkspace/
36+
!*.xcodeproj/project.xcworkspace/contents.xcworkspacedata
37+
**/ios/Pods/
38+
**/ios/build/
39+
40+
# IDE
41+
.idea/
42+
.vscode/
43+
*.swp
44+
*.swo
45+
46+
# Bun lockfile is committed for reproducible CI installs

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
lib/
3+
dist/
4+
coverage/
5+
.expo/
6+
android/
7+
ios/
8+
nitrogen/

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 80,
6+
"tabWidth": 2
7+
}

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Contributing to react-native-nitro-maps
2+
3+
Thank you for your interest in contributing!
4+
5+
## Development setup
6+
7+
1. Install [Bun](https://bun.sh/) and Node.js 22+.
8+
2. Clone the repository and install dependencies:
9+
10+
```bash
11+
bun install
12+
```
13+
14+
3. Build the library:
15+
16+
```bash
17+
bun run build
18+
```
19+
20+
4. Run the example app:
21+
22+
```bash
23+
bun run example start
24+
```
25+
26+
## Scripts
27+
28+
| Script | Description |
29+
| --- | --- |
30+
| `bun run lint` | Run ESLint across the monorepo |
31+
| `bun run typecheck` | Type-check the library package |
32+
| `bun run build` | Build the library with react-native-builder-bob |
33+
| `bun run nitrogen` | Run Nitrogen codegen (when specs are ready) |
34+
| `bun run format` | Format all files with Prettier |
35+
36+
## Pull request guidelines
37+
38+
- Keep changes focused and well-scoped.
39+
- Run `bun run lint`, `bun run typecheck`, and `bun run build` before opening a PR.
40+
- Follow existing naming conventions and avoid `any` in TypeScript.
41+
- Update documentation when changing public APIs.
42+
43+
## Code style
44+
45+
- TypeScript strict mode is enforced.
46+
- Use Prettier for formatting (`bun run format`).
47+
- Place imports at the top of files.
48+
- Use exhaustive switch handling for discriminated unions.
49+
50+
## Reporting issues
51+
52+
Please use [GitHub Issues](https://github.com/YOUR_GITHUB/react-native-nitro-maps/issues) and include:
53+
54+
- Library version
55+
- React Native / Expo version
56+
- Platform (iOS / Android)
57+
- Steps to reproduce
58+
- Expected vs actual behavior

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 YOUR_NAME
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# react-native-nitro-maps
2+
3+
High-performance maps for React Native, built on [Nitro Modules](https://nitro.margelo.com) and the New Architecture.
4+
5+
> **Status: Work in Progress** — This library is in early development. The public API is defined but native map rendering is not yet implemented. Components render placeholders.
6+
7+
## Goals
8+
9+
- **Performance first** — Leverage Nitro Modules and JSI for zero-bridge map interactions.
10+
- **New Architecture native** — Built exclusively for React Native's New Architecture (Fabric + TurboModules).
11+
- **Cross-platform** — MapKit on iOS, Google Maps on Android, with a unified TypeScript API.
12+
- **Developer experience** — Familiar component API inspired by `react-native-maps`, with full TypeScript support.
13+
- **Tree-shakeable** — ESM-only build with proper `exports` map for optimal bundle size.
14+
15+
## Installation
16+
17+
```bash
18+
bun add react-native-nitro-maps react-native-nitro-modules
19+
```
20+
21+
> Requires React Native 0.78+ with the New Architecture enabled.
22+
23+
## Usage
24+
25+
```tsx
26+
import { MapView, Marker, Polyline } from 'react-native-nitro-maps';
27+
28+
function MyMap() {
29+
return (
30+
<MapView
31+
style={{ flex: 1 }}
32+
mapType="standard"
33+
onRegionChangeComplete={(region) => console.log(region)}
34+
>
35+
<Marker
36+
coordinate={{ latitude: 52.2297, longitude: 21.0122 }}
37+
title="Warsaw"
38+
/>
39+
<Polyline
40+
coordinates={[
41+
{ latitude: 52.2297, longitude: 21.0122 },
42+
{ latitude: 52.237, longitude: 21.017 },
43+
]}
44+
strokeColor="#FF0000"
45+
strokeWidth={3}
46+
/>
47+
</MapView>
48+
);
49+
}
50+
```
51+
52+
### Imperative API
53+
54+
```tsx
55+
import { useRef } from 'react';
56+
import { MapView, type MapViewRef } from 'react-native-nitro-maps';
57+
58+
function ControlledMap() {
59+
const mapRef = useRef<MapViewRef>(null);
60+
61+
const flyToWarsaw = () => {
62+
mapRef.current?.animateCamera({
63+
center: { latitude: 52.2297, longitude: 21.0122 },
64+
zoom: 12,
65+
});
66+
};
67+
68+
return <MapView ref={mapRef} style={{ flex: 1 }} />;
69+
}
70+
```
71+
72+
## Public API
73+
74+
### Components
75+
76+
| Component | Description |
77+
| --- | --- |
78+
| `MapView` | Root map container |
79+
| `Marker` | Point annotation |
80+
| `Polyline` | Line overlay |
81+
| `Polygon` | Filled area overlay |
82+
| `Circle` | Circular area overlay |
83+
84+
### Types
85+
86+
| Type | Description |
87+
| --- | --- |
88+
| `Coordinate` | `{ latitude, longitude }` |
89+
| `Region` | Center + span |
90+
| `Camera` | Position, zoom, heading, pitch |
91+
| `MapType` | `'standard' \| 'satellite' \| 'hybrid' \| 'terrain'` |
92+
| `MapViewRef` | Imperative handle for camera control |
93+
| `MapViewProps` | Props for `MapView` |
94+
| `MarkerProps` | Props for `Marker` |
95+
| `PolylineProps` | Props for `Polyline` |
96+
| `PolygonProps` | Props for `Polygon` |
97+
| `CircleProps` | Props for `Circle` |
98+
99+
### Utilities
100+
101+
| Function | Description |
102+
| --- | --- |
103+
| `regionFromCoordinate(coord, latDelta?, lonDelta?)` | Create a `Region` from a coordinate |
104+
| `distanceBetween(a, b)` | Haversine distance in meters |
105+
106+
## Roadmap
107+
108+
See [docs/roadmap.md](docs/roadmap.md) for the full development plan.
109+
110+
| Phase | Status | Description |
111+
| --- | --- | --- |
112+
| 1. Skeleton | In progress | Project structure, types, placeholder components |
113+
| 2. Nitro View | Planned | Nitrogen codegen, native MapView HybridView |
114+
| 3. MapKit (iOS) | Planned | Apple MapKit integration |
115+
| 4. Google Maps (Android) | Planned | Google Maps SDK integration |
116+
| 5. Overlays | Planned | Markers, polylines, polygons, circles |
117+
| 6. Events & gestures | Planned | Press, long-press, region change |
118+
| 7. Clustering | Planned | Marker clustering |
119+
| 8. Polish & release | Planned | Performance, docs, v1.0 |
120+
121+
## Planned features
122+
123+
- MapKit and Google Maps rendering
124+
- Markers with callouts and drag support
125+
- Polylines, polygons, and circles
126+
- Camera animations and imperative control
127+
- Region and press event callbacks
128+
- Marker clustering
129+
- Custom map styles
130+
- Offline tile caching (future)
131+
132+
## Development
133+
134+
```bash
135+
# Install dependencies
136+
bun install
137+
138+
# Build the library
139+
bun run build
140+
141+
# Run linting and type checks
142+
bun run lint
143+
bun run typecheck
144+
145+
# Start the example app
146+
bun run example start
147+
```
148+
149+
See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
150+
151+
## Architecture
152+
153+
See [docs/architecture.md](docs/architecture.md) for the technical architecture overview.
154+
155+
## License
156+
157+
MIT — see [LICENSE](LICENSE).

0 commit comments

Comments
 (0)