vue-cesium
Version:
Vue 3.x components for CesiumJS.
1 lines • 6.05 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/measurements/src/distance/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-10-11 09:17:23\n * @LastEditTime: 2022-06-24 16:56:41\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\measurements\\src\\distance\\index.ts\n */\nimport { ComputedRef, defineComponent, Ref } from 'vue'\nimport useDrawingSegment from '@vue-cesium/composables/use-drawing/use-drawing-segment'\nimport { useDrawingActionProps } from '@vue-cesium/composables/use-drawing/props'\nimport type { PropType } from 'vue'\nimport { MeasureUnits } from '@vue-cesium/shared'\nimport type { VcLabelProps, VcPointProps } from '../../../primitive-collections'\nimport type { VcGeometryPolylineProps } from '../../../geometries'\nimport { drawingEmit } from '@vue-cesium/utils/emits'\nimport type { VcPrimitiveGroundPolylineProps, VcPrimitiveProps } from '../../../primitives'\nimport {\n MeasurementDecimals,\n VcDrawingDrawEvt,\n VcDrawingEditorEvt,\n VcDrawingMouseEvt,\n VcDrawingPreRenderDatas,\n VcDrawTipOpts,\n VcEditorOpts,\n VcSegmentDrawing\n} from '@vue-cesium/utils/drawing-types'\nimport { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject } from '@vue-cesium/utils/types'\n\nexport default defineComponent({\n name: 'VcMeasurementDistance',\n props: {\n ...useDrawingActionProps,\n showComponentLines: {\n type: Boolean,\n default: false\n },\n measureUnits: Object as PropType<MeasureUnits>,\n polylineOpts: Object as PropType<VcGeometryPolylineProps>,\n primitiveOpts: Object as PropType<VcPrimitiveProps & VcPrimitiveGroundPolylineProps>,\n labelOpts: Object as PropType<VcLabelProps>,\n xLabelOpts: Object as PropType<VcLabelProps>,\n xAngleLabelOpts: Object as PropType<VcLabelProps>,\n yLabelOpts: Object as PropType<VcLabelProps>,\n yAngleLabelOpts: Object as PropType<VcLabelProps>,\n locale: String,\n decimals: Object as PropType<MeasurementDecimals>,\n autoUpdateLabelPosition: Boolean\n },\n emits: drawingEmit,\n setup(props, ctx) {\n // state\n return useDrawingSegment(props, ctx, 'VcMeasurementDistance')\n }\n})\n\nexport type VcMeasurementDistanceProps = {\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 the unit of measurement\n */\n measureUnits?: MeasureUnits\n /**\n * Specify parameters for drawing polylines.\n */\n polylineOpts?: VcGeometryPolylineProps\n /**\n * Specify parameters for drawing primitives.\n */\n primitiveOpts?: VcPrimitiveProps & VcPrimitiveGroundPolylineProps\n /**\n * Specify parameters for measurement labels.\n */\n labelOpts?: VcLabelProps\n /**\n * Specify parameters for measurement locale.\n */\n locale?: string\n /**\n * Specify parameters for measurement decimals.\n */\n decimals?: MeasurementDecimals\n /**\n * Specify whether the depthTest is disabled.\n * Default value: false\n */\n disableDepthTest?: boolean\n /**\n * Specify whether to update label position.\n * Default value: true\n */\n autoUpdateLabelPosition?: boolean\n xLabelOpts?: VcLabelProps\n xAngleLabelOpts?: VcLabelProps\n yLabelOpts?: VcLabelProps\n yAngleLabelOpts?: VcLabelProps\n /**\n * Triggers before the VcMeasurementDistance is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcMeasurementDistance 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 VcMeasurementDistance is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * \tTriggers when drawing.\n */\n onDrawEvt?: (evt: VcDrawingDrawEvt<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 VcMeasurementDistanceRef extends VcComponentPublicInstance<VcMeasurementDistanceProps> {\n /**\n * Get the array of rendering models.\n */\n renderDatas?: Ref<VcSegmentDrawing[]>\n /**\n * Get the computedRenderDatas.\n */\n computedRenderDatas?: ComputedRef<VcSegmentDrawing[]>\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,4BAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,uBAAA;AAAA,EACN,KAAO,EAAA;AAAA,IACL,GAAG,qBAAA;AAAA,IACH,kBAAoB,EAAA;AAAA,MAClB,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,IACA,YAAc,EAAA,MAAA;AAAA,IACd,YAAc,EAAA,MAAA;AAAA,IACd,aAAe,EAAA,MAAA;AAAA,IACf,SAAW,EAAA,MAAA;AAAA,IACX,UAAY,EAAA,MAAA;AAAA,IACZ,eAAiB,EAAA,MAAA;AAAA,IACjB,UAAY,EAAA,MAAA;AAAA,IACZ,eAAiB,EAAA,MAAA;AAAA,IACjB,MAAQ,EAAA,MAAA;AAAA,IACR,QAAU,EAAA,MAAA;AAAA,IACV,uBAAyB,EAAA,OAAA;AAAA,GAC3B;AAAA,EACA,KAAO,EAAA,WAAA;AAAA,EACP,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAO,OAAA,iBAAA,CAAkB,KAAO,EAAA,GAAA,EAAK,uBAAuB,CAAA,CAAA;AAAA,GAC9D;AACF,CAAC,CAAA;;;;"}