UNPKG

@dspacev-bundle/vue-cesium

Version:
1 lines 7.45 kB
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/primitives/ground-polyline/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-03-22 13:20:52\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\primitives\\ground-polyline\\index.ts\n */\n// import type { ExtractPropTypes } from 'vue'\nimport { createCommentVNode, defineComponent, getCurrentInstance, h, Ref } from 'vue'\nimport type { VcAppearance, VcComponentInternalInstance, VcComponentPublicInstance, VcPickEvent, VcReadyObject } from '@vue-cesium/utils/types'\nimport { usePrimitives } from '@vue-cesium/composables'\nimport {\n geometryInstances,\n appearance,\n show,\n interleave,\n compressVertices,\n releaseGeometryInstances,\n allowPicking,\n asynchronous,\n classificationType,\n debugShowBoundingVolume,\n debugShowShadowVolume,\n enableMouseEvent\n} from '@vue-cesium/utils/cesium-props'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { hSlot } from '@vue-cesium/utils/private/render'\nimport { primitiveEmits } from '@vue-cesium/utils/emits'\n\nexport const groundPolylinePrimitiveProps = {\n ...geometryInstances,\n ...appearance,\n ...show,\n ...interleave,\n ...compressVertices,\n ...releaseGeometryInstances,\n ...allowPicking,\n ...asynchronous,\n ...classificationType,\n ...debugShowBoundingVolume,\n ...debugShowShadowVolume,\n ...enableMouseEvent\n}\nexport default defineComponent({\n name: 'VcPrimitiveGroundPolyline',\n props: groundPolylinePrimitiveProps,\n emits: primitiveEmits,\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'GroundPolylinePrimitive'\n usePrimitives(props, ctx, instance)\n\n const name = instance.proxy?.$options.name || ''\n return () =>\n ctx.slots.default\n ? h(\n 'i',\n {\n class: kebabCase(name),\n style: { display: 'none !important' }\n },\n hSlot(ctx.slots.default)\n )\n : createCommentVNode(kebabCase(name))\n }\n})\n\nexport type VcPrimitiveGroundPolylineProps = {\n /**\n * GeometryInstances containing GroundPolylineGeometry\n */\n geometryInstances?: Cesium.GeometryInstance | Array<Cesium.GeometryInstance>\n /**\n * The Appearance used to render the polyline. Defaults to a white color Material on a PolylineMaterialAppearance.\n */\n appearance?: VcAppearance\n /**\n * Determines if this primitive will be shown.\n * Default value: true\n */\n show?: boolean\n /**\n * When true, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * Default value: false\n */\n interleave?: boolean\n /**\n * When true, the primitive does not keep a reference to the input geometryInstances to save memory.\n * Default value: true\n */\n releaseGeometryInstances?: boolean\n /**\n * When true, each geometry instance will only be pickable with Scene#pick. When false, GPU memory is saved.\n * Default value: true\n */\n allowPicking?: boolean\n /**\n * Determines if the primitive will be created asynchronously or block until ready.\n * Default value: true\n */\n asynchronous?: boolean\n /**\n * Determines whether terrain, 3D Tiles or both will be classified.\n * Default value: ClassificationType.BOTH(2)\n */\n classificationType?: number\n /**\n * For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * Default value: false\n */\n debugShowBoundingVolume?: boolean\n /**\n * For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true on creation to have effect.\n * Default value: false\n */\n debugShowShadowVolume?: boolean\n /**\n * Specifies whether to respond to mouse pick events.\n * Default Value: true\n */\n enableMouseEvent?: boolean\n /**\n * Triggers before the component is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the component 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 component is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the mouse is pressed on this primitive.\n */\n onMousedown?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse bounces up on this primitive.\n */\n onMouseup?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse clicks on this primitive.\n */\n onClick?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse clicks outside this primitive.\n */\n onClickout?: (evt: VcPickEvent) => void\n /**\n * Triggers when the left mouse button double-clicks this primitive.\n */\n onDblclick?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse moves on this primitive.\n */\n onMousemove?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse moves over to this primitive.\n */\n onMouseover?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse moves out of this primitive.\n */\n onMouseout?: (evt: VcPickEvent) => void\n /**\n * Triggers when the primitive is ready to render.\n */\n onReadyPromise?: (primitive: Cesium.ClassificationPrimitive, viewer: Cesium.Viewer, instance: VcComponentPublicInstance) => void\n 'onUpdate:geometryInstances'?: (instances: Array<Cesium.GeometryInstance>) => void\n}\n\nexport interface VcPrimitiveGroundPolylineRef extends VcComponentPublicInstance<VcPrimitiveGroundPolylineProps> {\n /**\n * private but needed by VcGeometryInstance\n * @param geometryInstance\n * @param index\n */\n __updateGeometryInstances?(geometryInstance: Cesium.GeometryInstance, index: number): boolean\n /**\n * private but needed by VcGeometryInstance\n * @param geometryInstance\n */\n __removeGeometryInstances?(geometryInstance: Cesium.GeometryInstance): boolean\n /**\n * private but needed by VcGeometryInstance\n */\n __childCount?: Ref<number>\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,4BAA+B,GAAA;AAAA,EAC1C,GAAG,iBAAA;AAAA,EACH,GAAG,UAAA;AAAA,EACH,GAAG,IAAA;AAAA,EACH,GAAG,UAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,wBAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,kBAAA;AAAA,EACH,GAAG,uBAAA;AAAA,EACH,GAAG,qBAAA;AAAA,EACH,GAAG,gBAAA;AACL,EAAA;AACA,8BAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,2BAAA;AAAA,EACN,K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