npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-mapboxgl-zt

v1.0.0

Published

一个基于mapbox和react的地图组件库

Downloads

29

Readme

入门

本组件是基于 mapboxgl 开发的,以达到简化地图应用开发的目的,并且本组件的api与官方基本保持一致,因此,开发者在使用之前最好对mapboxgl的基本用法有一定的了解,具体可以参考官方文档

安装

1.使用包管理器

建议使用包管理器进行安装(例如 npmyarnpnpm 等),以便可以使用打包工具(例如 webpack 或者 vite 等)进行打包。

执行以下命令进行安装:


# 选择一个你喜欢的包管理器

# NPM
$ npm install react-mapboxgl-zt --save

# Yarn
$ yarn add react-mapboxgl-zt

# pnpm
$ pnpm install react-mapboxgl-zt

2.浏览器直接引入

如果你的项目不使用打包工具,可以直接在浏览器中引入 cdn 链接。引入之后就可以在全局使用ReactMap变量了

<head>
  <!-- Import style -->
  <link
    rel="stylesheet"
    href="https://www.unpkg.com/[email protected]/dist/index.css"
  />
  <!-- Import library -->
  <script src="https://www.unpkg.com/[email protected]/dist/index.umd.js"></script>
</head>

同时在引入之前需要引入 ReactReactDOMbabel 这三个库。

<head>
  <!-- Import React -->
  <script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/react/18.2.0/umd/react.development.js"></script>
  <!-- Import ReactDOM -->
  <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/react-dom/18.2.0/umd/react-dom.development.js"></script>
  <!-- Import babel -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.23.3/babel.min.js"></script>
</head>

:::info{title=提示} 我们建议使用 CDN 引入 react-mapboxgl-zt 的用户在链接地址上锁定版本,以免将来 react-mapboxgl-zt 升级时受到非兼容性更新的影响。 锁定版本的方法请查看 unpkg.com。 :::