UNPKG

vue-cesium

Version:
1 lines 6.61 kB
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/measurements/src/area/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:24\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\measurements\\src\\area\\index.ts\n */\nimport type { ComputedRef, PropType, Ref } from 'vue'\nimport { defineComponent } from 'vue'\nimport useDrawingPolyline from '@vue-cesium/composables/use-drawing/use-drawing-polyline'\nimport { useDrawingActionProps } from '@vue-cesium/composables/use-drawing/props'\nimport { MeasureUnits } from '@vue-cesium/shared'\nimport type { VcGeometryPolylineProps } from '../../../geometries'\nimport type { VcLabelProps, VcPointProps, VcPolygonProps } from '../../../primitive-collections'\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 VcPolylineDrawing\n} from '@vue-cesium/utils/drawing-types'\nimport { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject } from '@vue-cesium/utils/types'\n\nexport default defineComponent({\n name: 'VcMeasurementArea',\n props: {\n ...useDrawingActionProps,\n measureUnits: Object as PropType<MeasureUnits>,\n polylineOpts: Object as PropType<VcGeometryPolylineProps>,\n primitiveOpts: Object as PropType<VcPrimitiveProps & VcPrimitiveGroundPolylineProps>,\n polygonOpts: Object as PropType<VcPolygonProps>,\n labelOpts: Object as PropType<VcLabelProps>,\n labelsOpts: Object as PropType<VcLabelProps>,\n locale: String,\n decimals: Object as PropType<MeasurementDecimals>,\n showDistanceLabel: Boolean,\n showAngleLabel: Boolean,\n showLabel: Boolean,\n loop: Boolean,\n clampToGround: Boolean,\n autoUpdateLabelPosition: Boolean\n },\n emits: drawingEmit,\n setup(props, ctx) {\n // state\n return useDrawingPolyline(props, ctx, 'VcMeasurementArea')\n }\n})\n\nexport type VcMeasurementAreaProps = {\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 drawing polygons.\n */\n polygonOpts?: VcPolygonProps\n /**\n * Specify parameters for measurement labels.\n */\n labelOpts?: VcLabelProps\n /**\n * Specify parameters for measurement labels.\n */\n labelsOpts?: 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 to display the label.\n */\n showLabel?: boolean\n /**\n * Specify whether to display distance labels.\n */\n showDistanceLabel?: boolean\n /**\n * Specify whether to display angle labels.\n */\n showAngleLabel?: boolean\n /**\n * Specify whether a line segment will be added between the last and first line positions to make this line a loop.\n */\n loop?: boolean\n /**\n * Specify whether the drawing result object is attached to the ground or 3dtiles. Only polyline and polygon objects work.\n */\n clampToGround?: boolean\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 /**\n * Triggers before the VcMeasurementArea is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcMeasurementArea 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 VcMeasurementArea is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when drawing.\n */\n onDrawEvt?: (evt: VcDrawingDrawEvt<VcPolylineDrawing>, 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 VcMeasurementAreaRef extends VcComponentPublicInstance<VcMeasurementAreaProps> {\n /**\n * Get the array of rendering models.\n */\n renderDatas?: Ref<VcPolylineDrawing[]>\n /**\n * Get the computedRenderDatas.\n */\n computedRenderDatas?: ComputedRef<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,wBAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,mBAAA;AAAA,EACN,KAAO,EAAA;AAAA,IACL,GAAG,qBAAA;AAAA,IACH,YAAc,EAAA,MAAA;AAAA,IACd,YAAc,EAAA,MAAA;AAAA,IACd,aAAe,EAAA,MAAA;AAAA,IACf,WAAa,EAAA,MAAA;AAAA,IACb,SAAW,EAAA,MAAA;AAAA,IACX,UAAY,EAAA,MAAA;AAAA,IACZ,MAAQ,EAAA,MAAA;AAAA,IACR,QAAU,EAAA,MAAA;AAAA,IACV,iBAAmB,EAAA,OAAA;AAAA,IACnB,cAAgB,EAAA,OAAA;AAAA,IAChB,SAAW,EAAA,OAAA;AAAA,IACX,IAAM,EAAA,OAAA;AAAA,IACN,aAAe,EAAA,OAAA;AAAA,IACf,uBAAyB,EAAA,OAAA;AAAA,GAC3B;AAAA,EACA,KAAO,EAAA,WAAA;AAAA,EACP,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAO,OAAA,kBAAA,CAAmB,KAAO,EAAA,GAAA,EAAK,mBAAmB,CAAA,CAAA;AAAA,GAC3D;AACF,CAAC,CAAA;;;;"}