Closed tommywu23 closed 6 years ago
index.html
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=eBGR7XzaPhB5UbYARl3E7ksdkMdgrCw7"></script>
package.json
"dependencies": { "react-bmap": "^1.0.55",
React Components
import { Map } from 'react-bmap' ... <Map center={{lng: 116.402544, lat: 39.928216}} zoom="12" />
runtime error: Uncaught ReferenceError: BMap is not defined
现在需要在页面中先引入jsapi的脚本,如
还未做异步加载地图jsapi处理
@hinikai 请问npm安装之后在哪里引入jsapi的脚本?我是npm安装之后运行报了ReferenceError: BMap is not defined的错
@huangxiaohao 在html里加就行了:
...
index.html
package.json
React Components
runtime error: Uncaught ReferenceError: BMap is not defined