首页 / 浏览问题 / WebGIS / 问题详情
获取不到EchartsLayer
2EXP 2023年04月24日

使用产品:iserver 8c 810

操作系统:win10 x64

文件类型:vue

问题详细描述: 在vue中使用mapboxgl+echarts ,无法获取到EchartsLayer

问题重现步骤:

import mapboxgl from 'mapbox-gl';
import * as a from '@supermap/iclient-mapboxgl'; 
console.log(a); // 没有EchartsLayer

1个回答

您好,vue不支持include-mapboxgl.js这种集合快捷引用的方式,

使用vue的话你需要每个包手动去引,

比如打开include-mapboxgl.js中,可以看到“echarts”模块下,有

'https://iclient.supermap.io/web/libs/echarts/4.9.0/echarts.min.js'
'https://iclient.supermap.io/web/libs/echarts-liquidfill/2.0.6/echarts-liquidfill.min.js'
'https://iclient.supermap.io/web/libs/echartsLayer/EchartsLayer.min.js'

这些文件就需要您手动引入vue。

希望可以帮助到您。

于丁
1
9,633EXP 2023年04月24日

非常感谢,可以正常使用了yes

...