vue3+echarts-gl+echarts 为什么修改地图标签,没有效果?-灵析社区

一只tomatoo

![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/e756df5040d37506829c8daaccf396cb.png) option这样配置。为什么修改标签的颜色和字体大小都没有效果(label下的textStyle) (echarts-gl:v2.0.9;echarts: v5.4.3;vue:3.2.13) const option = { geo3D: { zlevel: -100, show: true, map: geoName, // 地图类型。echarts-gl 中使用的地图类型同 geo 组件相同 regionHeight: 2, shading: 'realistic', realisticMaterial: { // detailTexture: './1.png' }, itemStyle: { borderWidth: 1.5, borderColor: '#5FB9DA', color: '#6597D0', opacity: 1 }, label: { show: true, // 是否显示标签。 textStyle: { // 这里为什么没有效果 color: '#fff', // 地图初始化区域字体颜色 fontSize: 40 }, formatter: (e) => { return ` ${e.name} `; } } }, series: [ { zlevel: -10, regionHeight: 2, type: 'map3D', map: geoName, // 地图类型。echarts-gl 中使用的地图类型同 geo 组件相同 data: mapData, //这里比较重要:获得过滤后的data,这样点击事件时就能获得这个data的值 emphasis: { label: { show: false }, itemStyle: { color: 'transparent' } }, shading: 'realistic', realisticMaterial: { // detailTexture: './4.png', textureTiling: 2 }, itemStyle: { color: 'transparent' } } ] };

阅读量:19

点赞量:0

问AI
找到解决办法了,官方文档的api并不能生效(如下)。 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241206/3487face5a9ef992e78a29f49eb21049.png) 改为: 将 color 属性直接放置在 label 内,不放在 textStyle 内 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241206/ecb7dfa5c51132ba051f867fb49c1059.png)