[go: up one dir, main page]

Skip to content

pansyjs/react-mapbox-gl

Repository files navigation

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} />;
};