vue-cesium
Version:
Vue 3.x components for CesiumJS.
1 lines • 5.46 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/analyses/src/sightline/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2022-01-04 21:42:14\n * @LastEditTime: 2022-08-22 20:31:06\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\analyses\\src\\sightline\\index.ts\n */\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport { defineComponent } from 'vue'\nimport { useDrawingActionProps } from '@vue-cesium/composables/use-drawing/props'\nimport useDrawingPolyline from '@vue-cesium/composables/use-drawing/use-drawing-polyline'\nimport type { VcPrimitiveGroundPolylineProps, VcPrimitiveProps } from '../../../primitives'\nimport type { VcGeometryPolylineProps } from '../../../geometries'\nimport useDrawingSegment from '@vue-cesium/composables/use-drawing/use-drawing-segment'\nimport { VcPointProps, VcPolygonProps } from '../../../primitive-collections'\nimport { drawingEmit } from '@vue-cesium/utils/emits'\nimport {\n VcDrawingDrawEvt,\n VcDrawingEditorEvt,\n VcDrawingMouseEvt,\n VcDrawingPreRenderDatas,\n VcDrawTipOpts,\n VcEditorOpts,\n VcPolylineDrawing,\n VcSegmentDrawing\n} from '@vue-cesium/utils/drawing-types'\nimport { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject } from '@vue-cesium/utils/types'\n\nexport default defineComponent({\n name: 'VcAnalysisSightline',\n props: {\n ...useDrawingActionProps,\n polylineOpts: Object as PropType<VcGeometryPolylineProps>,\n polygonOpts: Object as PropType<VcPolygonProps>,\n primitiveOpts: Object as PropType<VcPrimitiveProps & VcPrimitiveGroundPolylineProps>,\n sightlineType: {\n type: String as PropType<'segment' | 'polyline' | 'circle'>,\n default: 'polyline'\n }\n },\n emits: drawingEmit,\n setup(props, ctx) {\n // state\n if (props.sightlineType === 'segment' || props.sightlineType === 'circle') {\n return useDrawingSegment(props, ctx, 'VcAnalysisSightline')\n } else if (props.sightlineType === 'polyline') {\n return useDrawingPolyline(props, ctx, 'VcAnalysisSightline')\n }\n }\n})\n\nexport type VcAnalysisSightlineProps = {\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 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 * Specify parameters for drawing polylines.\n */\n polylineOpts?: VcGeometryPolylineProps\n /**\n * Specify parameters for drawing polygons.\n */\n polygonOpts?: VcPolygonProps\n /**\n * Specify parameters for drawing primitives.\n */\n primitiveOpts?: VcPrimitiveProps & VcPrimitiveGroundPolylineProps\n /**\n * Specify the type of sightline.\n */\n sightlineType?: 'segment' | 'polyline'\n /**\n * Triggers before the VcAnalysisSightline is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcAnalysisSightline 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 VcAnalysisSightline is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * \tTriggers when drawing.\n */\n onDrawEvt?: (evt: VcDrawingDrawEvt<VcPolylineDrawing | VcSegmentDrawing>, 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 VcAnalysisSightlineRef extends VcComponentPublicInstance<VcAnalysisSightlineProps> {\n /**\n * Get the array of rendering models.\n */\n renderDatas?: Ref<Array<VcSegmentDrawing | VcPolylineDrawing>>\n /**\n * Get the computedRenderDatas.\n */\n computedRenderDatas?: ComputedRef<Array<VcSegmentDrawing | VcPolylineDrawing>>\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":";;;;;;;AA6BA,0BAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,qBAAA;AAAA,EACN,KAAO,EAAA;AAAA,IACL,GAAG,qBAAA;AAAA,IACH,YAAc,EAAA,MAAA;AAAA,IACd,WAAa,EAAA,MAAA;AAAA,IACb,aAAe,EAAA,MAAA;AAAA,IACf,aAAe,EAAA;AAAA,MACb,IAAM,EAAA,MAAA;AAAA,MACN,OAAS,EAAA,UAAA;AAAA,KACX;AAAA,GACF;AAAA,EACA,KAAO,EAAA,WAAA;AAAA,EACP,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAA,IAAI,KAAM,CAAA,aAAA,KAAkB,SAAa,IAAA,KAAA,CAAM,kBAAkB,QAAU,EAAA;AACzE,MAAO,OAAA,iBAAA,CAAkB,KAAO,EAAA,GAAA,EAAK,qBAAqB,CAAA,CAAA;AAAA,KAC5D,MAAA,IAAW,KAAM,CAAA,aAAA,KAAkB,UAAY,EAAA;AAC7C,MAAO,OAAA,kBAAA,CAAmB,KAAO,EAAA,GAAA,EAAK,qBAAqB,CAAA,CAAA;AAAA,KAC7D;AAAA,GACF;AACF,CAAC,CAAA;;;;"}