- Declarative and intuitive component-based API
- Automatic script loading - NaverMapProvider loads the Naver Maps API when needed
- Full TypeScript support with type safety
npm install react-naver-map-sdk
# or
yarn add react-naver-map-sdk
# or
pnpm add react-naver-map-sdkThe library provides a simple way to integrate Naver Maps into your React application. Wrap your app with NaverMapProvider and use the map components as needed.
import { NaverMapProvider, Map, Marker } from 'react-naver-map-sdk';
function App() {
return (
<NaverMapProvider client="YOUR_CLIENT_ID">
<Map mapId="123">
<Marker position={{ lat: 37.3595704, lng: 127.105399 }}/>
</Map>
</NaverMapProvider>
);
}All components must be used within the NaverMapProvider context. The provider handles the Naver Maps script loading and context initialization.
For detailed usage and examples, please refer to our official documentation.
If you find a bug or have a feature request, please follow these steps:
- Create a new issue
- Create a new branch for your issue (
git checkout -b feature/issue-number) - Make your changes
- Commit your changes (
git commit -m 'feat: brief description') - Push the branch (
git push origin feature/issue-number) - Create a Pull Request
Local development is broken into two parts (ideally using two tabs).
First, run rollup to watch your src/ module and automatically recompile it into dist/ whenever you make changes:
npm start # runs rollup with watch flagSecond, run the example app in examples/ directory that's linked to the local version of your module:
# in another tab
cd examples
npm start # runs create-react-app dev serverNow, anytime you make a change to your library in src/ or to the example app's examples/src, it will live-reload your local dev server.
If you get the error Module not found: Can't resolve 'react-naver-map-sdk' while trying to run the example app, you need to manually link your local development module:
- In the root folder:
npm link- Go into
examples/and (after installing other dependencies):
npm link react-naver-map-sdkMIT © Seohyeon Kim, Seonghun Kang