pansyjs / react-mapbox-gl

🌍 基于 Mapbox GL 封装的 React 组件库

Home Page:https://mapbox-gl.xingkang.wang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

🌍 基于 Mapbox GL 封装的 React 组件库

https://mapbox-gl.xingkang.wang

License:MIT License


Languages

Language:TypeScript 98.8%Language:JavaScript 1.2%Language:MDX 0.0%