useSceneDrillPick
使用 Cesium.Scene.drillPick 函数执行屏幕点拾取,返回包含拾取结果的计算属性。
Usage
ts
const windowPosition = shallowRef(new Cesium.Cartesian2());
const picks = useSceneDrillPick(windowPosition, { /** options */ });
Type Definitions
typescript
import type { Cartesian2 } from 'cesium';
import type { ComputedRef, MaybeRefOrGetter } from 'vue';
export interface UseSceneDrillPickOptions {
/**
* Whether to activate the pick function.
* @default true
*/
isActive?: MaybeRefOrGetter<boolean | undefined>;
/**
* Throttled sampling (ms)
* @default 8
*/
throttled?: number;
/**
* If supplied, stop drilling after collecting this many picks.
*/
limit?: MaybeRefOrGetter<number | undefined>;
/**
* The width of the pick rectangle.
* @default 3
*/
width?: MaybeRefOrGetter<number | undefined>;
/**
* The height of the pick rectangle.
* @default 3
*/
height?: MaybeRefOrGetter<number | undefined>;
}
/**
* Uses the `scene.drillPick` function to perform screen point picking,
* return a computed property containing the pick result, or undefined if no object is picked.
*
* @param windowPosition The screen coordinates of the pick point.
*/
export declare function useSceneDrillPick(windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>, options?: UseSceneDrillPickOptions): ComputedRef<any[] | undefined>;