ehcarts 與 百度地圖結合時,百度地圖的配置是以bmap屬性來設置的。但卻不知道如何獲取bmap對象的實例?
毫無疑問,是包含在echarts實例中的。
傳送門:https://blog.csdn.net/yc_1993/article/details/52431989
// ehcarts 的實例對象 this.myChart = echarts.init(el) // ehcarts加載完成事件 this.myChart.on('finished', () => { // 從echarts對象中獲取bmap對象 var bmap = this.myChart.getModel().getComponent('bmap').getBMap(); // 設置最小縮放值 bmap.setMinZoom(13); // 設置最大縮放值 bmap.setMaxZoom(15); // 縮放結束后的事件 bmap.addEventListener('zoomend', function () { // 打印出當前縮放值 console.log(20180925104046, bmap.getZoom()); }) })
