This is the tiny developer documentation for react-naver-maps-kit.
# Start of react-naver-maps-kit documentation
# React Naver Maps KIT
react-naver-maps-kit is a React binding for NAVER Maps JavaScript API v3.
It provides declarative components, automatic lifecycle handling, and TypeScript-friendly APIs for map applications.
The library centers around three ideas:
- SDK loading and auth are handled once by `NaverMapProvider`.
- Map and overlay instances are created/destroyed by React component lifecycle.
- Map state can be used in controlled or uncontrolled style.
```tsx
import { NaverMapProvider, NaverMap, Marker } from "react-naver-maps-kit";
export default function App() {
return (
);
}
```
## Quick Start
Install:
```bash
npm install react-naver-maps-kit
```
Alternative package managers:
```bash
pnpm add react-naver-maps-kit
# or
yarn add react-naver-maps-kit
# or
bun add react-naver-maps-kit
```
Prerequisites:
- Create NAVER Maps credentials in Naver Cloud Platform.
- Allow your site domain in key settings.
- Pass key as `ncpKeyId`.
- Give map container explicit width/height.
Minimal provider + map setup:
```tsx
import { NaverMapProvider, NaverMap } from "react-naver-maps-kit";
function Page() {
return (
);
}
```
## Feature Summary
- Declarative React components for map and overlays
- High-level hooks for SDK and instance access
- Rich event prop support on map and overlays
- Built-in clustering and data-layer components
- Optional submodules (`panorama`, `visualization`, `drawing`, `geocoder`, `gl`)
- GL vector map mode support
- TypeScript-first API surface
## Mental Model
- `NaverMapProvider` is responsible for SDK loading, auth, and SDK status state.
- `NaverMap` and `Panorama` provide instance context (`map` or `panorama`) to child components.
- Overlay components subscribe to instance context and mount native objects when ready.
- Props updates are diffed and applied with imperative NAVER Maps API calls.
- Unmount performs cleanup (listeners, overlays, instances).
## Core API: NaverMapProvider
`NaverMapProvider` is the root boundary for SDK status and map availability.
Main responsibilities:
- Load NAVER Maps SDK script
- Track status: `idle | loading | ready | error`
- Expose retry/reload and error-clear actions
- Validate submodule combinations
Important props:
- `ncpKeyId`: NAVER Maps credential key id
- `submodules?: ("geocoder" | "panorama" | "drawing" | "visualization" | "gl")[]`
- `autoLoad?: boolean` (default `true`)
- `timeoutMs?: number`
- `onReady?: () => void`
- `onError?: (error: Error) => void`
Important rules:
- `gl` cannot be combined with any other submodule.
- If SDK loading fails, `sdkStatus` becomes `error` and `sdkError` is set.
Provider with status UI:
```tsx
import { NaverMapProvider, useNaverMap } from "react-naver-maps-kit";
function StatusBanner() {
const { sdkStatus, sdkError, reloadSdk } = useNaverMap();
if (sdkStatus === "loading") return