Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个代码迁到vue2.0 导致页面直接卡死崩溃 #83

Closed
action9981 opened this issue May 9, 2024 · 2 comments
Closed

这个代码迁到vue2.0 导致页面直接卡死崩溃 #83

action9981 opened this issue May 9, 2024 · 2 comments

Comments

@action9981
Copy link

`[


<script> import S3MTilesLayer from './S3M_module/S3MTiles/S3MTilesLayer'; export default { name: 'CesiumMap', mounted() { // 确保 Cesium 全局对象可用 // if (typeof Cesium !== 'undefined') { // const viewer = new Cesium.Viewer(this.$el, { // imageryProvider: new Cesium.IonImageryProvider({ assetId: 2 }), // baseLayerPicker: false, // geocoder: false // }); // } else { // console.error('Cesium is not loaded'); // } let viewer = new Cesium.Viewer('cesiumContainer',{ }); let scene = viewer.scene; let layer = new S3MTilesLayer({ context : scene._context, url: '.D:\\work\\eserver\\supermap-s3m-load\\s3m-spec\\S3M_SDK\\S3M_JS\\data\\CBD\\cbd.scp' }); scene.primitives.add(layer); layer.readyPromise.then(function() { scene.camera.setView({ destination : new Cesium.Cartesian3(-2181968.890329965, 4385313.17843029, 4072712.8241634783), orientation : { heading : 3.1756648661534443, pitch : -0.3715184468182904 } }); }).otherwise(function(error) { console.log(error); }); } } </script>

]

这里的 import 加入就崩溃 不加入 就没事import S3MTilesLayer from './S3M_module/S3MTiles/S3MTilesLayer';

@heqianhq
Copy link
Contributor

好的,研发正在看,后续有修改会更新。

@heqianhq
Copy link
Contributor

可以通过去掉源码中的混淆代码来解决该问题,具体操作如下:在S3ModelParser.js文件中将下面引用注释掉,并注释代码中使用的地方即可。需要注意:经过该操作后,可以加范例数据,但不支持加Draco和MeshOPT压缩的数据。
图片1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants