vue-cesium
Version:
Vue 3.x components for CesiumJS.
1 lines • 7.61 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/graphics/label/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-06 09:23:59\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\graphics\\label\\index.ts\n */\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type {\n VcCallbackPropertyFunction,\n VcCartesian2,\n VcColor,\n VcComponentInternalInstance,\n VcComponentPublicInstance,\n VcDistanceDisplayCondition,\n VcNearFarScalar,\n VcPosition,\n VcReadyObject\n} from '@vue-cesium/utils/types'\nimport { useGraphics } from '@vue-cesium/composables'\nimport {\n show,\n text,\n font,\n labelStyle,\n scale,\n showBackground,\n backgroundColor,\n backgroundPadding,\n pixelOffset,\n eyeOffset,\n horizontalOrigin,\n verticalOrigin,\n heightReference,\n fillColor,\n outlineColor,\n outlineWidth,\n translucencyByDistance,\n pixelOffsetScaleByDistance,\n scaleByDistance,\n distanceDisplayCondition,\n disableDepthTestDistance\n} from '@vue-cesium/utils/cesium-props'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { commonEmits } from '@vue-cesium/utils/emits'\nexport const labelGraphicsProps = {\n ...show,\n ...text,\n ...font,\n ...labelStyle,\n ...scale,\n ...showBackground,\n ...backgroundColor,\n ...backgroundPadding,\n ...pixelOffset,\n ...eyeOffset,\n ...horizontalOrigin,\n ...verticalOrigin,\n ...heightReference,\n ...fillColor,\n ...outlineColor,\n ...outlineWidth,\n ...translucencyByDistance,\n ...pixelOffsetScaleByDistance,\n ...scaleByDistance,\n ...distanceDisplayCondition,\n ...disableDepthTestDistance\n}\nexport default defineComponent({\n name: 'VcGraphicsLabel',\n props: labelGraphicsProps,\n emits: commonEmits,\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'LabelGraphics'\n useGraphics(props, ctx, instance)\n\n return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || 'v-if'))\n }\n})\n\nexport type VcGraphicsLabelProps = {\n /**\n * A boolean Property specifying the visibility of the label.\n * Default value: true\n */\n show?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n /**\n * A Property specifying the text. Explicit newlines '\\n' are supported.\n */\n text?: string | Cesium.CallbackProperty | VcCallbackPropertyFunction<string>\n /**\n * A Property specifying the CSS font.\n * Default value: 30px sans-serif\n */\n font?: string | Cesium.CallbackProperty | VcCallbackPropertyFunction<string>\n /**\n * A Property specifying the LabelStyle.\n * Default value: Cesium.LabelStyle.FILL\n */\n labelStyle?: number | Cesium.LabelStyle | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A numeric Property specifying the scale to apply to the text.\n * Default value: 1.0\n */\n scale?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A boolean Property specifying the visibility of the background behind the label.\n * Default value: false\n */\n showBackground?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n /**\n * A Property specifying the background Color.\n * Default value: { x: 0.165, y: 0.165, z: 0.165, w: 0.8 }\n */\n backgroundColor?: VcColor\n /**\n * A VcCartesian2 Property specifying the horizontal and vertical background padding in pixels.\n * Default value: { x: 7, y: 5 }\n */\n backgroundPadding?: VcCartesian2\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: HorizontalOrigin.CENTER\n */\n horizontalOrigin?: number | Cesium.HorizontalOrigin | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A Property specifying the VerticalOrigin.\n * Default value: VerticalOrigin.CENTER\n */\n verticalOrigin?: number | Cesium.VerticalOrigin | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A Property specifying what the height is relative to.\n * Default value: HeightReference.NONE\n */\n heightReference?: number | Cesium.HeightReference | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A Property specifying the fill Color.\n * Default value: white\n */\n fillColor?: VcColor\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 * Default value: 1.0\n */\n outlineWidth?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\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 VcNearFarScalar Property used to set scale based on distance from the camera.\n */\n scaleByDistance?: VcNearFarScalar\n /**\n * A Property specifying at what distance from the camera that this label 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 VcGraphicsLabel is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcGraphicsLabel 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 VcGraphicsLabel 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 VcGraphicsLabelRef = VcComponentPublicInstance<VcGraphicsLabelProps>\n"],"names":[],"mappings":";;;;;;;;AA8CO,MAAM,kBAAqB,GAAA;AAAA,EAChC,GAAG,IAAA;AAAA,EACH,GAAG,IAAA;AAAA,EACH,GAAG,IAAA;AAAA,EACH,GAAG,UAAA;AAAA,EACH,GAAG,KAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,iBAAA;AAAA,EACH,GAAG,WAAA;AAAA,EACH,GAAG,SAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,SAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,sBAAA;AAAA,EACH,GAAG,0BAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,wBAAA;AAAA,EACH,GAAG,wBAAA;AACL,EAAA;AACA,oBAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,kBAAA;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,eAAA,CAAA;AACvB,IAAY,WAAA,CAAA,KAAA,EAAO,KAAK,QAAQ,CAAA,CAAA;AAEhC,IAAA,OAAO,MAAG;AA/Ed,MAAA,IAAA,EAAA,CAAA;AA+EiB,MAAA,OAAA,kBAAA,CAAmB,YAAU,EAAS,GAAA,QAAA,CAAA,KAAA,KAAT,mBAAgB,QAAS,CAAA,IAAA,KAAQ,MAAM,CAAC,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GACpF;AACF,CAAC,CAAA;;;;"}