使用百度地图出错,在echarts示例上可以实现,在本地实现不了,代码
var bMap = myChart.getModel().getComponent('bmap').getBMap();
bMap.addControl(new BMap.MapTypeControl({
mapTypes: [
BMAP_HYBRID_MAP,
BMAP_NORMAL_MAP
]
}));
bMap.setMapType(BMAP_HYBRID_MAP);
错误:
Uncaught TypeError: Cannot read property 'getComponent' of undefined
at Object.success (lines-bmap-effect.html:78)
at fire (jquery.js:3501)
at Object.fireWith [as resolveWith] (jquery.js:3631)
at done (jquery.js:9797)
at XMLHttpRequest. (jquery.js:10058)
echarts使用百度地图错误,在echarts示例上可以实现,在本地实现不了
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
崽崽的谷雨 2021-08-31 18:17关注示例版本和你本地库得版本一样吗?getComponent这个属性是undefined.你打印一下myChat看看有没有etModel()和getComponent
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报