UNPKG

vue-cesium

Version:
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 '@vue-cesium/composables/use-drawing/props'\nimport useDrawingPoint from '@vue-cesium/composables/use-drawing/use-drawing-point'\nimport type { VcBillboardProps, VcLabelProps, VcPointProps } from '../../../primitive-collections'\nimport { drawingEmit } from '@vue-cesium/utils/emits'\nimport type { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject } from '@vue-cesium/utils/types'\nimport {\n VcDrawingDrawEvt,\n VcDrawingEditorEvt,\n VcDrawingMouseEvt,\n VcDrawingPreRenderDatas,\n VcDrawTipOpts,\n VcEditorOpts,\n VcPointDrawing\n} from '@vue-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":";;;;;;AAyBA,mBAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,cAAA;AAAA,EACN,KAAO,EAAA;AAAA,IACL,GAAG,qBAAA;AAAA,IACH,aAAe,EAAA,MAAA;AAAA,IACf,SAAW,EAAA,MAAA;AAAA,IACX,eAAiB,EAAA,MAAA;AAAA,IACjB,SAAW,EAAA,OAAA;AAAA,GACb;AAAA,EACA,KAAO,EAAA,WAAA;AAAA,EACP,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAO,OAAA,eAAA,CAAgB,KAAO,EAAA,GAAA,EAAK,cAAc,CAAA,CAAA;AAAA,GACnD;AACF,CAAC,CAAA;;;;"}