Open liuxiaoqiang1018 opened 1 year ago
<!-- 首页3D地图 --> <!-- map json https://geo.datav.aliyun.com/areas_v3/bound/370200_full.json --> <template> <div class="home-map-root"> <div class="home-map" ref="homeMap" id="homeMap">homeMap</div> </div> </template> <script> import { qing_tao_map_json } from '../../json/map_json.js' import 'echarts-gl'; export default { data() { return { } }, created() { }, mounted() { this.$echarts.registerMap("QingTaoMap", qing_tao_map_json); let mEcharts = this.$echarts.init(this.$refs.homeMap); let option = { geo3D: { // 将geo3d放在最底层 zlevel: -1, map: 'QingTaoMap', regionHeight: 1,//区域的高度,通俗点说就是厚度 itemStyle: { height: 1, color: '#2B5890', //地图颜色 borderWidth: 0.5, //分界线wdith borderColor: '#333', //分界线颜色 }, label: { show: true, //是否显示label color: '#fff', //文字颜色 fontSize: 20, //文字大小 }, regions: [ { name: '即墨区', // 区域名称 height: 2, itemStyle: { borderWidth: 10, // 设置该区域的边缘宽度 //****这个设置不起作用 */ borderColor: "#ff0",//设置该区域的边缘颜色 color: '#f00',// 设置该区域的背景颜色 }, }, ], }, title: { }, series: [ ], }; mEcharts.setOption(option,true); }, methods: { }, } </script> <style scoped lang='less'> .home-map-root { height: 100%; width: 100%; } .home-map { height: 100%; width: 17.5rem; // background-color: blueviolet; } </style>
.
yes, textStyle for geo3D.label and geo3D.regions.label is redundant in v.5.5.0. Workaround until fixed someday: use attributes (like color,fontSize) directly, without textStyle - Demo
ok;3q
单独设置区域里的 regions.itemStyle.borderColor不起作用
.