@vuemap/vue-amap-extra
Version:
@vuemap/vue-amap扩展库,包含threejs相关图层
89 lines (86 loc) • 2.26 kB
JavaScript
import { defineComponent, openBlock, createElementBlock } from 'vue';
import { buildProps, useRegister } from '@vuemap/vue-amap';
import { Layer3DTiles } from '@vuemap/layer-3dtiles';
var script = /* @__PURE__ */ defineComponent({
...{
name: "ElAmapThreeTiles3d",
inheritAttrs: false
},
__name: "ThreeTiles3d",
props: buildProps({
//地址
url: {
type: String,
required: true
},
// 位置
position: {
type: Object
},
// 缩放比例
scale: {
type: Object
},
// 旋转角度
rotation: {
type: Object
},
// 模型偏移设置
translate: {
type: Object
},
// DRACOLoader 的decoder路径,默认使用CDN路径,默认:https://cdn.jsdelivr.net/npm/three@0.143/examples/js/libs/draco/
dracoDecoderPath: {
type: String
},
// 使用fetch下载文件的参数
fetchOptions: {
type: Object
},
// 是否开启事件,默认false
mouseEvent: {
type: Boolean,
default: false
},
// 是否开启debug,开启后将会在页面最顶部显示当前模型处理情况, 默认 false
debug: {
type: Boolean,
default: false
},
autoFocus: {
type: Boolean,
default: false
},
//加载后是否自动将地图中心点移动到模型中心,仅在不传position时生效
configLoader: {
type: Function
}
}),
emits: ["init"],
setup(__props, { expose: __expose, emit: __emit }) {
const emits = __emit;
let $amapComponent;
const { $$getInstance, parentInstance } = useRegister((options, parentComponent) => {
return new Promise((resolve) => {
$amapComponent = new Layer3DTiles(parentComponent, options);
resolve($amapComponent);
});
}, {
emits,
destroyComponent() {
if ($amapComponent && (parentInstance == null ? void 0 : parentInstance.$amapComponent)) {
$amapComponent.destroy();
$amapComponent = null;
}
}
});
__expose({
$$getInstance
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div");
};
}
});
export { script as default };
//# sourceMappingURL=ThreeTiles3d.vue2.mjs.map