判断字体文件已加载完再重绘
//字体
@font-face {
font-family: "YSBTH";
src: url("../../assets/fonts/YSBTH.ttf");
}
let _this = this;
//检测字体加载完
document.fonts.ready.then(function () {
_this.chart.resize();
});
geo3D: {
show: true,
map: 'JH',
zlevel: 6,
label: {
formatter: function (params) {
return params.name + 2;
},
show: false,
},
emphasis: {
//当鼠标放上去 地区区域是否显示名称
label: {
fontFamily: 'YSBTH',//存在字体不生效问题
show: false,
},
itemStyle: {
color: '#022bf3a1',
},
},
...mapConfig
},