Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.16 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.16 KB

React Mapbox GL

🌍 基于 mapbox-gl 封装的 React 组件库.

Forks Stars npm version

🏗 安装

# npm
$ npm install mapbox-gl @pansy/react-mapbox-gl

# yarn
$ yarn add mapbox-gl @pansy/react-mapbox-gl

# pnpm
$ pnpm i mapbox-gl @pansy/react-mapbox-gl

🔨 使用

import { Map } from '@pansy/react-mapbox-gl';

import type { MapProps } from '@pansy/react-mapbox-gl';

const config: MapProps = {
  accessToken: 'YOUR_MAPBOX_ACCESS_TOKEN',
  style: 'mapbox://styles/mapbox/dark-v11',
};

export default () => {
  return <Map {...config} />;
};