{"version":3,"file":"ThreeTiles3d.vue2.mjs","sources":["../../../../packages/Three3Dtiles/ThreeTiles3d.vue"],"sourcesContent":["<template>\r\n  <div />\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport {defineOptions} from 'vue';\r\nimport {useRegister, buildProps} from \"@vuemap/vue-amap\";\r\nimport {Layer3DTiles} from \"@vuemap/layer-3dtiles\";\r\nimport type {LngLat,Vec} from \"./Type\";\r\n\r\nimport type{PropType} from \"vue\";\r\nimport type {ConfigLoader} from \"../ThreeGltf/Type\";\r\n\r\ndefineOptions({\r\n  name: 'ElAmapThreeTiles3d',\r\n  inheritAttrs: false\r\n});\r\n\r\ndefineProps(buildProps({\r\n  //地址\r\n  url: {\r\n    type: String,\r\n    required: true\r\n  },\r\n  // 位置\r\n  position: {\r\n    type: Object as PropType<LngLat>,\r\n  },\r\n  // 缩放比例\r\n  scale: {\r\n    type: Object as PropType<number | Vec>\r\n  },\r\n  // 旋转角度\r\n  rotation: {\r\n    type: Object as PropType<Vec>\r\n  },\r\n  // 模型偏移设置\r\n  translate: {\r\n    type: Object as PropType<Vec>\r\n  },\r\n  // DRACOLoader 的decoder路径，默认使用CDN路径，默认：https://cdn.jsdelivr.net/npm/three@0.143/examples/js/libs/draco/\r\n  dracoDecoderPath: {\r\n    type: String,\r\n  },\r\n  // 使用fetch下载文件的参数\r\n  fetchOptions: {\r\n    type: Object,\r\n  },\r\n  // 是否开启事件,默认false\r\n  mouseEvent: {\r\n    type: Boolean,\r\n    default: false\r\n  },\r\n  // 是否开启debug，开启后将会在页面最顶部显示当前模型处理情况， 默认 false\r\n  debug: {\r\n    type: Boolean,\r\n    default: false\r\n  },\r\n  autoFocus: {\r\n    type: Boolean,\r\n    default: false\r\n  },//加载后是否自动将地图中心点移动到模型中心，仅在不传position时生效\r\n  configLoader: {\r\n    type: Function as PropType<ConfigLoader>\r\n  }\r\n}));\r\nconst emits = defineEmits(['init']);\r\n\r\nlet $amapComponent: Layer3DTiles;\r\n\r\nconst {$$getInstance, parentInstance} = useRegister<Layer3DTiles, any>((options, parentComponent) => {\r\n  return new Promise<Layer3DTiles>((resolve) => {\r\n    $amapComponent = new Layer3DTiles(parentComponent, options);\r\n    resolve($amapComponent);\r\n  });\r\n\r\n}, {\r\n  emits,\r\n  destroyComponent () {\r\n    if ($amapComponent && parentInstance?.$amapComponent) {\r\n      $amapComponent.destroy();\r\n      $amapComponent = null as any;\r\n    }\r\n  },\r\n});\r\n\r\ndefineExpose({\r\n  $$getInstance,\r\n});\r\n\r\n</script>\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAI,IAAA,cAAA,CAAA;AAEJ,IAAA,MAAM,EAAC,aAAe,EAAA,cAAA,KAAkB,WAA+B,CAAA,CAAC,SAAS,eAAoB,KAAA;AACnG,MAAO,OAAA,IAAI,OAAsB,CAAA,CAAC,OAAY,KAAA;AAC5C,QAAiB,cAAA,GAAA,IAAI,YAAa,CAAA,eAAA,EAAiB,OAAO,CAAA,CAAA;AAC1D,QAAA,OAAA,CAAQ,cAAc,CAAA,CAAA;AAAA,OACvB,CAAA,CAAA;AAAA,KAEA,EAAA;AAAA,MACD,KAAA;AAAA,MACA,gBAAoB,GAAA;AAClB,QAAI,IAAA,cAAA,KAAkB,iDAAgB,cAAgB,CAAA,EAAA;AACpD,UAAA,cAAA,CAAe,OAAQ,EAAA,CAAA;AACvB,UAAiB,cAAA,GAAA,IAAA,CAAA;AAAA,SACnB;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,aAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;"}