{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/graphics/billboard/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-08 11:32:32\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\graphics\\billboard\\index.ts\n */\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type {\n  VcBoundingRectangle,\n  VcCallbackPropertyFunction,\n  VcCartesian2,\n  VcColor,\n  VcComponentInternalInstance,\n  VcComponentPublicInstance,\n  VcDistanceDisplayCondition,\n  VcNearFarScalar,\n  VcPosition,\n  VcReadyObject\n} from 'casc-cesium-utils/types'\nimport { useGraphics } from 'casc-cesium-composables'\nimport {\n  show,\n  image,\n  scale,\n  pixelOffset,\n  eyeOffset,\n  horizontalOrigin,\n  verticalOrigin,\n  heightReference,\n  color,\n  rotation,\n  alignedAxis,\n  sizeInMeters,\n  width,\n  height,\n  scaleByDistance,\n  translucencyByDistance,\n  pixelOffsetScaleByDistance,\n  imageSubRegion,\n  distanceDisplayCondition,\n  disableDepthTestDistance\n} from 'casc-cesium-utils/cesium-props'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { graphicsEmits } from 'casc-cesium-utils/emits'\nexport const billboarGraphicsProps = {\n  ...image,\n  ...scale,\n  ...pixelOffset,\n  ...eyeOffset,\n  ...horizontalOrigin,\n  ...verticalOrigin,\n  ...heightReference,\n  ...color,\n  ...rotation,\n  ...alignedAxis,\n  ...sizeInMeters,\n  ...width,\n  ...height,\n  ...scaleByDistance,\n  ...translucencyByDistance,\n  ...pixelOffsetScaleByDistance,\n  ...disableDepthTestDistance,\n  ...show,\n  ...distanceDisplayCondition,\n  ...imageSubRegion\n}\nexport default defineComponent({\n  name: 'VcGraphicsBillboard',\n  props: billboarGraphicsProps,\n  emits: graphicsEmits,\n  setup(props, ctx) {\n    // state\n    const instance = getCurrentInstance() as VcComponentInternalInstance\n    instance.cesiumClass = 'BillboardGraphics'\n    useGraphics(props, ctx, instance)\n    return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || 'v-if'))\n  }\n})\n\nexport type VcGraphicsBillboardProps = {\n  /**\n   * A boolean Property specifying the visibility of the billboard.\n   * Default value: true\n   */\n  show?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A Property specifying the Image, URI, or Canvas to use for the billboard.\n   */\n  image?: string | HTMLCanvasElement | Cesium.CallbackProperty | VcCallbackPropertyFunction<string>\n  /**\n   * A numeric Property specifying the scale to apply to the image size.\n   * Default value: 1.0\n   */\n  scale?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A VcCartesian2 Property specifying the pixel offset.\n   * Default value: { x: 0, y: 0 }\n   */\n  pixelOffset?: VcCartesian2\n  /**\n   * A VcPosition Property specifying the eye offset.\n   * Default value: { x: 0, y: 0, z: 0 }\n   */\n  eyeOffset?: VcPosition\n  /**\n   * A Property specifying the HorizontalOrigin.\n   * Default value: 0\n   */\n  horizontalOrigin?: number | Cesium.HorizontalOrigin | VcCallbackPropertyFunction<number>\n  /**\n   * A Property specifying the VerticalOrigin.\n   * Default value: 0\n   */\n  verticalOrigin?: number | Cesium.VerticalOrigin | VcCallbackPropertyFunction<number>\n  /**\n   * A Property specifying what the height is relative to.\n   */\n  heightReference?: number | Cesium.HeightReference | VcCallbackPropertyFunction<number>\n  /**\n   * A Property specifying the tint Color of the image.\n   * Default value: white\n   */\n  color?: VcColor\n  /**\n   * A numeric Property specifying the rotation about the alignedAxis.\n   * Default value: 0\n   */\n  rotation?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A VcPosition Property specifying the unit vector axis of rotation.\n   * Default value: { x: 0, y: 0, z: 0 }\n   */\n  alignedAxis?: VcPosition\n  /**\n   * A boolean Property specifying whether this billboard's size should be measured in meters.\n   * Default value: false\n   */\n  sizeInMeters?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A numeric Property specifying the width of the billboard in pixels, overriding the native size.\n   */\n  width?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A numeric Property specifying the height of the billboard in pixels, overriding the native size.\n   */\n  height?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A VcNearFarScalar Property used to scale the point based on distance from the camera.\n   */\n  scaleByDistance?: VcNearFarScalar\n  /**\n   * A VcNearFarScalar Property used to set translucency based on distance from the camera.\n   */\n  translucencyByDistance?: VcNearFarScalar\n  /**\n   * A VcNearFarScalar Property used to set pixelOffset based on distance from the camera.\n   */\n  pixelOffsetScaleByDistance?: VcNearFarScalar\n  /**\n   * A Property specifying a BoundingRectangle that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left.\n   */\n  imageSubRegion?: VcBoundingRectangle\n  /**\n   * A Property specifying at what distance from the camera that this billboard will be displayed.\n   */\n  distanceDisplayCondition?: VcDistanceDisplayCondition\n  /**\n   * A Property specifying the distance from the camera at which to disable the depth test to.\n   */\n  disableDepthTestDistance?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * Triggers before the VcGraphicsBillboard is loaded.\n   */\n  onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when the VcGraphicsBillboard 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 VcGraphicsBillboard is destroyed.\n   */\n  onDestroyed?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when a property or sub-property is changed or modified.\n   */\n  onDefinitionChanged?: (property: Cesium.Property) => void\n}\n\nexport type VcGraphicsBillboardRef = VcComponentPublicInstance<VcGraphicsBillboardProps>\n"],"names":[],"mappings":";;;;;;;AA0BY,MAAC,qBAAqB,GAAG;AACrC,EAAE,GAAG,KAAK;AACV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