首页 / 浏览问题 / WebGIS / 问题详情
supmap es6引入
2EXP 2024年07月19日

SuperMap iClient3D 11i(2023) for WebGL_WebGPU 

import * as SuperMap3D from './SuperMap3D-es6.js'
console.log(" ~ SuperMap3D:", SuperMap3D)
var viewer = new SuperMap3D.Viewer('viewer');

引入后页面报错,请问是为什么

1个回答

您好,能否提供下完整代码?
1,180EXP 2024年07月22日

好的,这是截图 ,用的是SuperMap iClient3D 11i(2023) for WebGL_WebGPU

webgl不支持模块化导入,您需要在html中引入js文件

<script type="text/javascript" src="static/SuperMap3D/SuperMap3D.js"></script>
  <script type="text/javascript" src="static/SuperMap/SuperMap.Include.js"></script>

...