Closed amin168 closed 4 years ago
@amin168 你可以通过这个实例来添加第三方库
https://github.com/uiwjs/react-baidu-map/tree/master/src/CurveLine
通过 requireScript
方法懒加载第三方包。
https://github.com/uiwjs/react-baidu-map/blob/master/src/CurveLine/useCurveLine.tsx#L25-L31
方法 requireScript 已经导出。
import { requireScript } from '@uiw/react-baidu-map';
requireScript('//api.map.baidu.com/library/CurveLine/1.5/src/CurveLine.min.js')
.then(() => {
if (window.BMapLib) {
console.log(window.BMapLib);
}
}).catch(() => {
});
@amin168 目前没有空去封装,如果你急,你可以根据实例 来个 PR 。
@jaywcjlove 我先自己试着封装一下,到时来个PR
@jaywcjlove
我尝试运行npm run doc:dev
,但报了以下的错误,是缺少了什么组件吗。
我现在封装了一点,想测试一下
我发了一封邮件给你,想叫你拿个QQ或者WeChat的联系方式ヽ(ー_ー)ノ
@amin168 兼容windows环境变量要使用这个包 cross-env
环境变量只支持 Mac OS 和 Linux 系统。
@amin168 你试一试。
http://lbsyun.baidu.com/index.php?title=jspopular3.0/guide/mouse2draw
http://lbsyun.baidu.com/index.php?title=jspopular3.0/openlibrary
demo:https://lbsyun.baidu.com/jsdemo.htm#f0_7