apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.59k stars 19.62k forks source link

echarts调用百度地图时显示异常 #7470

Closed Snowfish1994 closed 4 years ago

Snowfish1994 commented 6 years ago

One-line summary [问题简述]

echarts调用百度地图,初始显示地图时有几率出现白边(上下左右边框位置,左右边框位置的白边高度100%,宽度随初始化窗口大小不同而不同,上下边框位置的白边宽度100%,高度随初始化窗口的大小不同而不同),初始化时的setCenter和移动地图后的setCenter位置有偏移,偏移大小与白边大小一致。 我目前理解为初始化时,百度地图获取echarts的容器时产生异常,导致地图整体偏移,而鼠标操作地图后百度地图获取的echarts容器为正常的,导致前后的setCenter的位置不同。

Version & Environment [版本及环境]

Expected behaviour [期望结果]

修复偏移问题

ECharts option [ECharts配置项]

option = {
        title : {
            text : 'test', //地图标题改这里
            left : 'left',//left center right 标题位置
                        textStyle:{
                             color:'white'
                        }
        },
        bmap : {
            roam : true,
            mapStyle:{style:'midnight'}
        }
    }

Other comments [其他信息]

wtfk

HTML CODE:

<!DOCTYPE html>

Insert title here
Snowfish1994 commented 6 years ago

目前已暂时使用setTimeout重设中心点的方法解决该问题,但该bug在echarts4上仍存在

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.