yangyanggu / vue-amap

高德地图封装 for vue2 vue3.0
https://vue-amap.guyixi.cn/
MIT License
268 stars 15 forks source link

ThreeJS 无法使用 Failed to resolve component: el-amap-layer-three #29

Closed zhonghua929 closed 1 year ago

zhonghua929 commented 1 year ago

使用版本

"@vuemap/vue-amap": "^2.0.4",
"@vuemap/vue-amap-extra": "^2.0.1",
"@vuemap/vue-amap-loca": "^2.0.2",

问题描述

参考ThreeJS的图层示例 el-amap-layer-three el-amap-three-light-ambient el-amap-three-light-directional el-amap-three-light-hemisphere el-amap-three-gltf 都出现错误 [Vue warn]: Failed to resolve component: el-amap-three-gltf If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <Model onVnodeUnmounted=fn ref=Ref< undefined > > at at at at at <Home onVnodeUnmounted=fn ref=Ref< undefined > > at at [Vue warn]: Failed to resolve component: el-amap-layer-three If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <Model onVnodeUnmounted=fn ref=Ref< undefined > > at at at at at <Home onVnodeUnmounted=fn ref=Ref< undefined > > at at

yangyanggu commented 1 year ago

你这是没注册组件吧

zhonghua929 commented 1 year ago

单独使用地图可以正常使用 vue-amap-loca组件 和 vue-amap-extra组件不能使用, main.ts注册了 import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap' 其他两个名称是什么 是如何注册呢?

yangyanggu commented 1 year ago

一样导入,那两个库也有全局导出 import Vue-amap loca from '@vuemap/vue-amap-loca'

zhonghua929 commented 1 year ago

可以了 多谢

zhonghua929 commented 1 year ago

THREE.GLTFLoader: No DRACOLoader instance provided 加载GLTF模型 能否加入DRACO解密 const loader = new GLTFLoader() const dracoLoader = new DRACOLoader() dracoLoader.setDecoderPath('/draco/gltf/') loader.setDRACOLoader(dracoLoader)

yangyanggu commented 1 year ago

THREE.GLTFLoader: No DRACOLoader instance provided 加载GLTF模型 能否加入DRACO解密 const loader = new GLTFLoader() const dracoLoader = new DRACOLoader() dracoLoader.setDecoderPath('/draco/gltf/') loader.setDRACOLoader(dracoLoader)

抱歉,目前因为身体原因没法进行更新,你可以去插件那提个pr自己增加下然后我让人重新发布下依赖的插件 https://github.com/AMap-Web/amap-three

zhonghua929 commented 1 year ago

已经添加 draco 变量 引入 DRACOLoader 提交了代码

yangyanggu commented 1 year ago

没有看到pr,你没有建pr吧

zhonghua929 commented 1 year ago

刚提交了

zhonghua929 commented 1 year ago

AMap-Web/amap-three 还没有发布吧, npm安装没有更新内容

yangyanggu commented 1 year ago

我改下实现吧,现在这个发布会影响线上的项目

zhonghua929 commented 1 year ago

npm i @amap/three-layer 还是0.0.4版本 也可以更新下谢谢

zhonghua929 commented 1 year ago

是不是不能在标签里使用 Error: THREE.GLTFLoader: No DRACOLoader instance provided. GLTFDracoMeshCompressionExtension GLTFLoader.js:1452 parse GLTFLoader.js:368 load GLTFLoader.js:205 load three.module.js:39930 promise callback*load three.module.js:39915 load GLTFLoader.js:201 init chunk-vendors.js:233 w chunk-vendors.js:230 CustomThreeGltf CustomThreeGltf.ts:28 initComponent ThreeGltf.vue:44 initComponent ThreeGltf.vue:43

yangyanggu commented 1 year ago

现在还不支持啊