{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/graphics/polygon/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-06 13:06:14\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\graphics\\polygon\\index.ts\n */\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type {\n  VcCallbackPropertyFunction,\n  VcColor,\n  VcComponentInternalInstance,\n  VcComponentPublicInstance,\n  VcDistanceDisplayCondition,\n  VcMaterial,\n  VcPolygonHierarchy,\n  VcReadyObject\n} from 'casc-cesium-utils/types'\nimport { useGraphics } from 'casc-cesium-composables'\nimport {\n  show,\n  hierarchy,\n  height,\n  heightReference,\n  extrudedHeight,\n  extrudedHeightReference,\n  stRotation,\n  granularity,\n  fill,\n  material,\n  outline,\n  outlineColor,\n  outlineWidth,\n  perPositionHeight,\n  closeTop,\n  closeBottom,\n  arcType,\n  shadows,\n  distanceDisplayCondition,\n  classificationType,\n  zIndex\n} from 'casc-cesium-utils/cesium-props'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { commonEmits } from 'casc-cesium-utils/emits'\nexport const polygonGraphicsProps = {\n  ...show,\n  ...hierarchy,\n  ...height,\n  ...heightReference,\n  ...extrudedHeight,\n  ...extrudedHeightReference,\n  ...stRotation,\n  ...granularity,\n  ...fill,\n  ...material,\n  ...outline,\n  ...outlineColor,\n  ...outlineWidth,\n  ...perPositionHeight,\n  ...closeTop,\n  ...closeBottom,\n  ...arcType,\n  ...shadows,\n  ...distanceDisplayCondition,\n  ...classificationType,\n  ...zIndex\n}\nexport default defineComponent({\n  name: 'VcGraphicsPolygon',\n  props: polygonGraphicsProps,\n  emits: commonEmits,\n  setup(props, ctx) {\n    // state\n    const instance = getCurrentInstance() as VcComponentInternalInstance\n    instance.cesiumClass = 'PolygonGraphics'\n    useGraphics(props, ctx, instance)\n\n    return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || 'v-if'))\n  }\n})\n\nexport type VcGraphicsPolygonProps = {\n  /**\n   * A boolean Property specifying the visibility of the polygon.\n   * Default value: true\n   */\n  show?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A Property specifying the VcPolygonHierarchy.\n   */\n  hierarchy?: VcPolygonHierarchy\n  /**\n   * A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.\n   */\n  height?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A Property specifying what the height is relative to.\n   */\n  heightReference?: number | Cesium.HeightReference | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.\n   */\n  extrudedHeight?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A Property specifying what the extrudedHeight is relative to.\n   */\n  extrudedHeightReference?: number | Cesium.HeightReference | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A numeric property specifying the rotation of the polygon texture counter-clockwise from north.\n   * Default value: 0.0\n   */\n  stRotation?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A numeric Property specifying the angular distance between each latitude and longitude point.\n   */\n  granularity?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A boolean Property specifying whether the polygon is filled with the provided material.\n   */\n  fill?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A Property specifying the material used to fill the polygon.\n   * Default value: white\n   */\n  material?: VcMaterial\n  /**\n   * A boolean Property specifying whether the polygon is outlined.\n   * Default value: false\n   */\n  outline?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A Property specifying the Color of the outline.\n   * Default value: black\n   */\n  outlineColor?: VcColor\n  /**\n   * A numeric Property specifying the width of the outline.\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * Default value: 1.0\n   */\n  outlineWidth?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A boolean specifying whether or not the height of each position is used.\n   * Default value: false\n   */\n  perPositionHeight?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * When false, leaves off the top of an extruded polygon open.\n   * Default value: true\n   */\n  closeTop?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * When false, leaves off the bottom of an extruded polygon open.\n   * Default value: true\n   */\n  closeBottom?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * The type of line the polygon edges must follow.\n   */\n  arcType?: number | Cesium.ArcType | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * An enum Property specifying whether the polygon casts or receives shadows from light sources.\n   * Default value: Cesium.ShadowMode.DISABLED\n   */\n  shadows?: number | Cesium.ShadowMode | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A Property specifying at what distance from the camera that this polygon will be displayed.\n   */\n  distanceDisplayCondition?: VcDistanceDisplayCondition\n  /**\n   * An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.\n   * Default value: Cesium.ClassificationType.BOTH\n   */\n  classificationType?: number | Cesium.ClassificationType | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.\n   */\n  zIndex?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * Triggers before the VcGraphicsPolygon is loaded.\n   */\n  onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when the VcGraphicsPolygon 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 VcGraphicsPolygon 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 VcGraphicsPolygonRef = VcComponentPublicInstance<VcGraphicsPolygonProps>\n"],"names":[],"mappings":";;;;;;;AA2BY,MAAC,oBAAoB,GAAG;AACpC,EAAE,GAAG,IAAI;AACT,EAAE,GAAG,SAAS;AACd,EAAE,GAAG,MAAM;AACX,EAAE,GAAG,eAAe;AACpB,EAAE,GAAG,cAAc;AACnB,EAAE,GAAG,uBAAuB;AAC5B,EAAE,GAAG,UAAU;AACf,EAAE,GAAG,WAAW;AAChB,EAAE,GAAG,IAAI;AACT,EAAE,GAAG,QAAQ;AACb,EAAE,GAAG,OAAO;AACZ,EAAE,GAAG,YAAY;AACjB,EAAE,GAAG,YAAY;AACjB,EAAE,GAAG,iBAAiB;AACtB,EAAE,GAAG,QAAQ;AACb,EAAE,GAAG,WAAW;AAChB,EAAE,GAAG,OAAO;AACZ,EAAE,GAAG,OAAO;AACZ,EAAE,GAAG,wBAAwB;AAC7B,EAAE,GAAG,kBAAkB;AACvB,EAAE,GAAG,MAAM;AACX,EAAE;AACF,sBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,mBAAmB;AAC3B,EAAE,KAAK,EAAE,oBAAoB;AAC7B,EAAE,KAAK,EAAE,WAAW;AACpB,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE;AACpB,IAAI,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AAC1C,IAAI,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAC7C,IAAI,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACtC,IAAI,OAAO,MAAM;AACjB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;AAClH,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;"}