UNPKG

casc-cesium

Version:

Vue 3.x components for CesiumJS.

1 lines 4.34 kB
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/drawings/src/pin/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-10-11 09:17:22\n * @LastEditTime: 2022-06-24 16:55:04\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\drawings\\src\\pin\\index.ts\n */\nimport type { PropType, Ref } from 'vue'\nimport { defineComponent } from 'vue'\nimport { useDrawingActionProps } from 'casc-cesium-composables/use-drawing/props'\nimport useDrawingPoint from 'casc-cesium-composables/use-drawing/use-drawing-point'\nimport type { VcBillboardProps, VcLabelProps, VcPointProps } from '../../../primitive-collections'\nimport { drawingEmit } from 'casc-cesium-utils/emits'\nimport type { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject } from 'casc-cesium-utils/types'\nimport {\n VcDrawingDrawEvt,\n VcDrawingEditorEvt,\n VcDrawingMouseEvt,\n VcDrawingPreRenderDatas,\n VcDrawTipOpts,\n VcEditorOpts,\n VcPointDrawing\n} from 'casc-cesium-utils/drawing-types'\n\nexport default defineComponent({\n name: 'VcDrawingPin',\n props: {\n ...useDrawingActionProps,\n billboardOpts: Object as PropType<VcBillboardProps>,\n labelOpts: Object as PropType<VcLabelProps>,\n heightReference: Number,\n showLabel: Boolean\n },\n emits: drawingEmit,\n setup(props, ctx) {\n // state\n return useDrawingPoint(props, ctx, 'VcDrawingPin')\n }\n})\n\nexport type VcDrawingPinProps = {\n /**\n * Specify whether to respond to mouse pick events.\n */\n enableMouseEvent?: boolean\n /**\n * Specify Whether the drawing object is visible.\n */\n show?: boolean\n /**\n * Specify whether the drawing result can be edited.\n */\n editable?: boolean\n /**\n * Specify drawing hints.\n */\n drawtip?: VcDrawTipOpts\n /**\n * Specify parameters for drawing points.\n */\n pointOpts?: VcPointProps\n /**\n * Specify parameters for drawing billbords.\n */\n billboardOpts?: VcBillboardProps\n /**\n * Specify parameters for drawing labels.\n */\n labelOpts?: VcLabelProps\n /**\n * Specify the heightReference.\n */\n heightReference?: number\n /**\n * Specify whether to display label.\n */\n showLabel: boolean\n /**\n * Specify whether the depthTest is disabled.\n * Default value: false\n */\n disableDepthTest?: boolean\n /**\n * Specify editor options.\n */\n editorOpts?: VcEditorOpts\n /**\n * Specify editor mode.\n */\n mode?: number\n /**\n * Specify prerender datas.\n */\n preRenderDatas?: VcDrawingPreRenderDatas\n /**\n * Triggers before the VcDrawingPin is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcDrawingPin 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 VcDrawingPin is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * \tTriggers when drawing.\n */\n onDrawEvt?: (evt: VcDrawingDrawEvt<VcPointDrawing>, viewer: Cesium.Viewer) => void\n /**\n * Triggers when the editor button is clicked.\n */\n onEditorEvt?: (evt: VcDrawingEditorEvt, viewer: Cesium.Viewer) => void\n /**\n * Triggers when the mouse is over or out on the drawing point.\n */\n onMouseEvt?: (evt: VcDrawingMouseEvt, viewer: Cesium.Viewer) => void\n}\n\nexport interface VcDrawingPinRef extends VcComponentPublicInstance<VcDrawingPinProps> {\n /**\n * Get or set the renderDatas.\n */\n renderDatas?: Ref<Array<VcPointDrawing>>\n /**\n * start a new draw.\n */\n startNew: () => void\n /**\n * stop drawing.\n */\n stop: (removeLatest?: boolean) => void\n /**\n * clear and stop drawing.\n */\n clear: () => void\n}\n"],"names":[],"mappings":";;;;;AAIA,mBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,cAAc;AACtB,EAAE,KAAK,EAAE;AACT,IAAI,GAAG,qBAAqB;AAC5B,IAAI,aAAa,EAAE,MAAM;AACzB,IAAI,SAAS,EAAE,MAAM;AACrB,IAAI,eAAe,EAAE,MAAM;AAC3B,IAAI,SAAS,EAAE,OAAO;AACtB,GAAG;AACH,EAAE,KAAK,EAAE,WAAW;AACpB,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE;AACpB,IAAI,OAAO,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AACvD,GAAG;AACH,CAAC,CAAC;;;;"}