vue-cesium
Version:
Vue 3.x components for CesiumJS.
1 lines • 3.14 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/geometries/box/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-03-30 10:18:51\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\geometries\\box\\index.ts\n */\nimport { VcComponentInternalInstance, VcComponentPublicInstance, VcPosition, VcReadyObject } from '@vue-cesium/utils/types'\nimport { defineComponent, getCurrentInstance, createCommentVNode } from 'vue'\nimport { useGeometries } from '@vue-cesium/composables'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { dimensions, vertexFormat } from '@vue-cesium/utils/cesium-props'\nimport { commonEmits } from '@vue-cesium/utils/emits'\nexport const boxGeometryProps = {\n ...dimensions,\n ...vertexFormat\n}\nexport default defineComponent({\n name: 'VcGeometryBox',\n props: boxGeometryProps,\n emits: commonEmits,\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'BoxGeometry'\n const geometriesState = useGeometries(props, ctx, instance)\n\n // methods\n instance.createCesiumObject = async () => {\n const options: any = geometriesState?.transformProps(props)\n return Cesium.BoxGeometry.fromDimensions(options)\n }\n\n return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n }\n})\n\nexport type VcGeometryBoxProps = {\n /**\n * The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3, respectively.\n */\n dimensions: VcPosition\n /**\n * The vertex attributes to be computed.\n */\n vertexFormat?: Cesium.VertexFormat\n /**\n * Triggers before the VcGeometryBox is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcGeometryBox is successfully loaded.\n */\n onReady?: (readyObject: VcReadyObject) => void\n /**\n * Triggers when the component load failed.\n */\n onUnready?: (e: any) => void\n /**\n * Triggers when the VcGeometryBox is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n}\n\nexport type VcGeometryBoxRef = VcComponentPublicInstance<VcGeometryBoxProps>\n"],"names":[],"mappings":";;;;;;;;AAcO,MAAM,gBAAmB,GAAA;AAAA,EAC9B,GAAG,UAAA;AAAA,EACH,GAAG,YAAA;AACL,EAAA;AACA,kBAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,eAAA;AAAA,EACN,KAAO,EAAA,gBAAA;AAAA,EACP,KAAO,EAAA,WAAA;AAAA,EACP,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAA,QAAA,CAAS,WAAc,GAAA,aAAA,CAAA;AACvB,IAAA,MAAM,eAAkB,GAAA,aAAA,CAAc,KAAO,EAAA,GAAA,EAAK,QAAQ,CAAA,CAAA;AAG1D,IAAA,QAAA,CAAS,qBAAqB,YAAY;AACxC,MAAM,MAAA,OAAA,GAAe,mDAAiB,cAAe,CAAA,KAAA,CAAA,CAAA;AACrD,MAAO,OAAA,MAAA,CAAO,WAAY,CAAA,cAAA,CAAe,OAAO,CAAA,CAAA;AAAA,KAClD,CAAA;AAEA,IAAA,OAAO,MAAG;AAlCd,MAAA,IAAA,EAAA,CAAA;AAkCiB,MAAA,OAAA,kBAAA,CAAmB,YAAU,EAAS,GAAA,QAAA,CAAA,KAAA,KAAT,mBAAgB,QAAS,CAAA,IAAA,KAAQ,EAAE,CAAC,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAChF;AACF,CAAC,CAAA;;;;"}