UNPKG

@vuemap/vue-amap-extra

Version:

@vuemap/vue-amap扩展库,包含threejs相关图层

93 lines (88 loc) 2.31 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); var vueAmap = require('@vuemap/vue-amap'); var layer3dtiles = require('@vuemap/layer-3dtiles'); var script = /* @__PURE__ */ vue.defineComponent({ ...{ name: "ElAmapThreeTiles3d", inheritAttrs: false }, __name: "ThreeTiles3d", props: vueAmap.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 } = vueAmap.useRegister((options, parentComponent) => { return new Promise((resolve) => { $amapComponent = new layer3dtiles.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 vue.openBlock(), vue.createElementBlock("div"); }; } }); exports.default = script; //# sourceMappingURL=ThreeTiles3d.vue2.js.map