useScenePick
This is a wrapper for Cesium.Scene.pick that retrieves the first object in the scene containing a primitive
property using screen coordinates.
Usage
ts
const windowPosition = shallowRef(new Cesium.Cartesian2());
const pick = useScenePick(windowPosition, { /** options */ });
Type Definitions
typescript
import type { Cartesian2 } from 'cesium';
import type { MaybeRefOrGetter, ShallowRef } from 'vue';
export interface UseScenePickOptions {
/**
* Whether to active the event listener.
* @default true
*/
isActive?: MaybeRefOrGetter<boolean>;
/**
* Throttled sampling (ms)
* @default 8
*/
throttled?: number;
/**
* 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.pick` function in Cesium's Scene object 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 useScenePick(windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>, options?: UseScenePickOptions): Readonly<ShallowRef<any | undefined>>;