Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ jobs:
run: bun run build

- name: Test
run: bun run --filter react-native-nitro-maps test
run: bun run --filter react-native-better-maps test
4 changes: 2 additions & 2 deletions CONTEXT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React Native Nitro Maps
# React Native Better Maps

Shared language for the map rendering domain in `react-native-nitro-maps`.
Shared language for the map rendering domain in `react-native-better-maps`.

## Language

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to react-native-nitro-maps
# Contributing to react-native-better-maps

Thank you for your interest in contributing!

Expand Down Expand Up @@ -70,7 +70,7 @@ chore: add commitlint configuration

## Reporting issues

Please use [GitHub Issues](https://github.com/YOUR_GITHUB/react-native-nitro-maps/issues) and include:
Please use [GitHub Issues](https://github.com/gmi-software/react-native-nitro-maps/issues) and include:

- Library version
- React Native / Expo version
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# react-native-nitro-maps
# react-native-better-maps

High-performance maps for React Native, built on [Nitro Modules](https://nitro.margelo.com) and the New Architecture.

Expand All @@ -15,7 +15,7 @@ High-performance maps for React Native, built on [Nitro Modules](https://nitro.m
## Installation

```bash
bun add react-native-nitro-maps react-native-nitro-modules
bun add react-native-better-maps react-native-nitro-modules
```

> Requires React Native 0.78+ with the New Architecture enabled.
Expand All @@ -29,7 +29,7 @@ export default {
expo: {
plugins: [
[
'react-native-nitro-maps',
'react-native-better-maps',
{
googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY,
locationPermission:
Expand Down Expand Up @@ -60,7 +60,7 @@ See [docs/expo-setup.md](docs/expo-setup.md) for a full Expo SDK 56 setup walkth
## Usage

```tsx
import { MapView, Marker, Polyline } from 'react-native-nitro-maps';
import { MapView, Marker, Polyline } from 'react-native-better-maps';

function MyMap() {
return (
Expand Down Expand Up @@ -90,7 +90,7 @@ function MyMap() {

```tsx
import { useRef } from 'react';
import { MapView, type MapViewRef } from 'react-native-nitro-maps';
import { MapView, type MapViewRef } from 'react-native-better-maps';

function ControlledMap() {
const mapRef = useRef<MapViewRef>(null);
Expand All @@ -112,7 +112,7 @@ function ControlledMap() {

```tsx
import { Platform } from 'react-native';
import { MapView, type MapProvider } from 'react-native-nitro-maps';
import { MapView, type MapProvider } from 'react-native-better-maps';

const provider: MapProvider = Platform.OS === 'android' ? 'google' : 'apple';

Expand Down Expand Up @@ -152,7 +152,7 @@ Host apps must provide platform API keys for the Google Maps SDK:
"expo": {
"plugins": [
[
"react-native-nitro-maps",
"react-native-better-maps",
{
"googleMapsApiKey": "YOUR_KEY_HERE"
}
Expand Down
17 changes: 8 additions & 9 deletions bun.lock

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

4 changes: 2 additions & 2 deletions docs/adr/0002-google-maps-ios-via-podspec.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Accepted

## Context

The iOS `google` provider compiles inside the `react-native-nitro-maps` CocoaPods target produced by React Native autolinking. Its Swift files import `GoogleMaps`, so the package target itself must declare and receive that dependency during `pod install`.
The iOS `google` provider compiles inside the `react-native-better-maps` CocoaPods target produced by React Native autolinking. Its Swift files import `GoogleMaps`, so the package target itself must declare and receive that dependency during `pod install`.

Google's iOS SDK documentation recommends Swift Package Manager for many app integrations, but adding Google Maps only to the host app with SPM would not satisfy the library pod target that compiles `GoogleMapProviderAdapter`.

## Decision

Declare `GoogleMaps` in `package/react-native-nitro-maps.podspec`.
Declare `GoogleMaps` in `package/react-native-better-maps.podspec`.

Host apps still own runtime configuration by providing a Google Maps iOS API key in their app bundle. The example app reads `GOOGLE_MAPS_IOS_API_KEY` with `GOOGLE_MAPS_API_KEY` as a shared fallback, then writes `GoogleMapsIosApiKey` through the package config plugin.

Expand Down
6 changes: 3 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

`react-native-nitro-maps` is a React Native maps library built on [Nitro Modules](https://nitro.margelo.com) and the New Architecture. It provides a familiar component-based API while leveraging JSI for high-performance native communication.
`react-native-better-maps` is a React Native maps library built on [Nitro Modules](https://nitro.margelo.com) and the New Architecture. It provides a familiar component-based API while leveraging JSI for high-performance native communication.

## Layer diagram

Expand All @@ -29,8 +29,8 @@
## Monorepo structure

```
react-native-nitro-maps/
├── package/ # Library package (react-native-nitro-maps)
react-native-better-maps/
├── package/ # Library package (react-native-better-maps)
│ ├── src/ # TypeScript source
│ ├── ios/ # Swift native code
│ ├── android/ # Kotlin native code
Expand Down
18 changes: 9 additions & 9 deletions docs/expo-setup.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Expo setup (SDK 56+)

This guide covers configuring `react-native-nitro-maps` in an Expo app with the New Architecture enabled.
This guide covers configuring `react-native-better-maps` in an Expo app with the New Architecture enabled.

## Prerequisites

- Expo SDK 56+
- React Native 0.78+ with New Architecture enabled (`newArchEnabled: true` in `app.json`)
- `react-native-nitro-modules` installed alongside `react-native-nitro-maps`
- `react-native-nitro-modules` installed alongside `react-native-better-maps`

## Install

```bash
bun add react-native-nitro-maps react-native-nitro-modules
bun add react-native-better-maps react-native-nitro-modules
```

## Config plugin
Expand All @@ -25,7 +25,7 @@ module.exports = {
// ...your existing config
plugins: [
[
'react-native-nitro-maps',
'react-native-better-maps',
{
googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY,
locationPermission:
Expand All @@ -41,11 +41,11 @@ module.exports = {

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `googleMapsApiKey` | `string` | — | Android: injects `com.google.android.geo.API_KEY` meta-data. iOS: no-op (MapKit needs no key; reserved for future Google Maps iOS support in [#2](https://github.com/gmi-software/react-native-nitro-maps/issues/2)). |
| `googleMapsApiKey` | `string` | — | Shared fallback used for both platforms when platform-specific keys are omitted. Android injects `com.google.android.geo.API_KEY`; iOS injects `GoogleMapsIosApiKey` for the `google` provider. |
| `locationPermission` | `string \| false` | — | When set to a string: iOS `NSLocationWhenInUseUsageDescription` + Android `ACCESS_FINE_LOCATION` and `ACCESS_COARSE_LOCATION`. |
| `locationAlwaysPermission` | `string \| false` | — | When set to a string: iOS `NSLocationAlwaysAndWhenInUseUsageDescription` + Android `ACCESS_BACKGROUND_LOCATION`. |

Omitting `googleMapsApiKey` does not fail prebuild. Android maps will not render until a key is provided (via the plugin or manually). iOS MapKit works without a key.
Omitting `googleMapsApiKey` does not fail prebuild. Android maps and the iOS `google` provider will not render until a key is provided (via the plugin or manually). The iOS `apple` provider works without a key.

## Google Maps API key

Expand Down Expand Up @@ -83,8 +83,8 @@ expo prebuild --clean

The plugin injects:

- **Android:** `com.google.android.geo.API_KEY` meta-data (when `googleMapsApiKey` is set) and location permissions (when location options are set)
- **iOS:** location usage description strings (when location options are set)
- **Android:** `com.google.android.geo.API_KEY` meta-data (when an Android or shared Google Maps API key is set) and location permissions (when location options are set)
- **iOS:** `GoogleMapsIosApiKey` in `Info.plist` (when an iOS or shared Google Maps API key is set) and location usage description strings (when location options are set)

## Run

Expand All @@ -110,5 +110,5 @@ The example's `prebuild` script builds the plugin (`build:plugin`) before runnin
| --- | --- |
| Blank map on Android | Ensure `googleMapsApiKey` is set and `expo prebuild` was run after adding the plugin. |
| Location dot not showing | Set `locationPermission` in the plugin options and re-run prebuild. |
| Plugin not found | Confirm `react-native-nitro-maps` is installed and listed in `plugins`. |
| Plugin not found | Confirm `react-native-better-maps` is installed and listed in `plugins`. |
| `Cannot find module './plugin/build/index'` | Run `bun run build:plugin` in the package (or `bun run build` from the repo root) before prebuild when using a workspace link. |
2 changes: 1 addition & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
type MapType,
type MapViewRef,
type OverlayEnteringAnimation,
} from 'react-native-nitro-maps';
} from 'react-native-better-maps';
import { MAP_SCENARIOS, type MapScenario } from './examples';

const MAP_TYPES: MapType[] = ['standard', 'satellite', 'hybrid'];
Expand Down
2 changes: 1 addition & 1 deletion example/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
plugins: [
...(appJson.expo.plugins ?? []),
[
'react-native-nitro-maps',
'react-native-better-maps',
{
iosGoogleMapsApiKey,
androidGoogleMapsApiKey,
Expand Down
2 changes: 1 addition & 1 deletion example/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"expo": {
"name": "NitroMapsExample",
"slug": "nitro-maps-example",
"slug": "better-maps-example",
"version": "1.0.0",
"orientation": "portrait",
"userInterfaceStyle": "light",
Expand Down
2 changes: 1 addition & 1 deletion example/examples/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EdgePadding, MapViewProps, Region } from 'react-native-nitro-maps';
import type { EdgePadding, MapViewProps, Region } from 'react-native-better-maps';

export interface MapScenarioAdvancedOptions {
clusteringEnabled?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ config.resolver.unstable_conditionNames = [
// components share the same module instance (required for MapView child collection).
config.resolver.extraNodeModules = {
...config.resolver.extraNodeModules,
'react-native-nitro-maps': path.resolve(monorepoRoot, 'package'),
'react-native-better-maps': path.resolve(monorepoRoot, 'package'),
};

module.exports = config;
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-native-nitro-maps-example",
"name": "react-native-better-maps-example",
"version": "0.0.1",
"private": true,
"main": "index.js",
Expand All @@ -14,7 +14,7 @@
"expo-status-bar": "~3.0.8",
"react": "19.2.3",
"react-native": "0.85.3",
"react-native-nitro-maps": "workspace:*",
"react-native-better-maps": "workspace:*",
"react-native-nitro-modules": "^0.35.10",
"react-native-reanimated": "4.3.1",
"react-native-worklets": "0.8.3"
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "react-native-nitro-maps-monorepo",
"name": "react-native-better-maps-monorepo",
"private": true,
"workspaces": [
"package",
"example"
],
"scripts": {
"build": "bun run --filter react-native-nitro-maps build",
"build": "bun run --filter react-native-better-maps build",
"lint": "eslint .",
"typecheck": "bun run --filter react-native-nitro-maps typecheck",
"typecheck:provider-types": "bun run --filter react-native-nitro-maps typecheck:provider-types",
"nitrogen": "bun run --filter react-native-nitro-maps nitrogen",
"example": "bun run --filter react-native-nitro-maps-example",
"typecheck": "bun run --filter react-native-better-maps typecheck",
"typecheck:provider-types": "bun run --filter react-native-better-maps typecheck:provider-types",
"nitrogen": "bun run --filter react-native-better-maps nitrogen",
"example": "bun run --filter react-native-better-maps-example",
"format": "prettier --write .",
"commitlint": "commitlint",
"prepare": "husky"
Expand Down
2 changes: 1 addition & 1 deletion package/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Expo apps can set the key with the package config plugin:
"expo": {
"plugins": [
[
"react-native-nitro-maps",
"react-native-better-maps",
{
"androidGoogleMapsApiKey": "YOUR_API_KEY"
}
Expand Down
2 changes: 1 addition & 1 deletion package/ios/GoogleMapsAPIKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum MapProviderConfigurationError: LocalizedError {
var errorDescription: String? {
switch self {
case .missingGoogleMapsIosApiKey:
return "react-native-nitro-maps: provider=\"google\" on iOS requires GoogleMapsIosApiKey in the host app Info.plist."
return "react-native-better-maps: provider=\"google\" on iOS requires GoogleMapsIosApiKey in the host app Info.plist."
case let .unsupportedIOSProvider(provider):
return "Map provider \"\(provider)\" is not supported on iOS."
}
Expand Down
2 changes: 1 addition & 1 deletion package/ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Expo apps can set the key with the package config plugin:
"expo": {
"plugins": [
[
"react-native-nitro-maps",
"react-native-better-maps",
{
"iosGoogleMapsApiKey": "YOUR_API_KEY"
}
Expand Down
10 changes: 5 additions & 5 deletions package/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-native-nitro-maps",
"name": "react-native-better-maps",
"version": "0.0.1",
"description": "High-performance maps for React Native built on Nitro Modules and the New Architecture",
"main": "./lib/module/index.js",
Expand All @@ -24,7 +24,7 @@
"android",
"cpp",
"nitro.json",
"react-native-nitro-maps.podspec",
"react-native-better-maps.podspec",
"!**/__tests__",
"!**/__fixtures__",
"!**/__mocks__"
Expand Down Expand Up @@ -54,12 +54,12 @@
],
"repository": {
"type": "git",
"url": "https://github.com/YOUR_GITHUB/react-native-nitro-maps.git"
"url": "https://github.com/gmi-software/react-native-nitro-maps.git"
},
"bugs": {
"url": "https://github.com/YOUR_GITHUB/react-native-nitro-maps/issues"
"url": "https://github.com/gmi-software/react-native-nitro-maps/issues"
},
"homepage": "https://github.com/YOUR_GITHUB/react-native-nitro-maps#readme",
"homepage": "https://github.com/gmi-software/react-native-nitro-maps#readme",
"author": "YOUR_NAME",
"license": "MIT",
"publishConfig": {
Expand Down
Loading
Loading