1 Star 0 Fork 48

堕落 / react-baidu-map

forked from zy_laoyang / react-baidu-map 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

react-baidu-map

这是一个基于 React 封装的百度地图组件,帮助你轻松的接入地图到 React 项目中,Gitee 镜像仓库

文档实例预览: Github | Gitee

特性

  • ♻️ 自动加载百度地图 SDK(通过创建 Script 标签的形式加载),包括第三方 SDK。
  • 📚 使用 Typescript 编写,集成百度地图 SDK @type 声明文件(包括中文注释)。
  • ⚛️ 支持 React Hook 新增特性(需要 React 16.8+)。
  • 💝 不依赖任何第三方组件。

安装

不依赖 uiw 组件库

npm install @uiw/react-baidu-map --save

使用

import { Map, APILoader } from '@uiw/react-baidu-map';

const Demo = () => (
  <div style={{ width: '100%', height: '300px' }}>
    <APILoader akay="GTrnXa5hwXGwgQnTBG28SHBubErMKm3f">
      <Map />
    </APILoader>
  </div>
);
ReactDOM.render(<Demo />, _mount_);

开发

npm install # 安装依赖

npm run ts:watch    # 监听编译输出 js 文件
npm run types:watch # 监听编译输出 .d.ts 类型文件
npm run doc:dev     # 文档网站运行

# 上传 gh-pages 将会执行 `npm run released` 命令
npm run deploy

# 发布
npm run released    # 编译输出 js 文件 和 .d.ts 类型文件
MIT License Copyright (c) 2019 uiw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

这是一个基于 React 封装的百度地图组件,帮助你轻松的接入地图到 React 项目中,支持 React Hook。 expand collapse
TypeScript
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
TypeScript
1
https://gitee.com/qa-laowang/react-baidu-map.git
git@gitee.com:qa-laowang/react-baidu-map.git
qa-laowang
react-baidu-map
react-baidu-map
master

Search