Skip to main content

flywave-mapview.mapview.intersectmapobjects

Home > @flywave/flywave-mapview > MapView > intersectMapObjects

MapView.intersectMapObjects() method

Do a raycast on all objects in the scene. Useful for picking.

Signature:

intersectMapObjects(x: number, y: number, parameters?: IntersectParams): PickResult[];

Parameters

Parameter

Type

Description

x

number

The X position in css/client coordinates (without applied display ratio).

y

number

The Y position in css/client coordinates (without applied display ratio).

parameters

IntersectParams

(Optional) The intersection test behaviour may be adjusted by providing an instance of .

Returns:



[PickResult](./flywave-mapview.pickresult.md)<!-- -->\[\]

The list of intersection results.

## Remarks

Limited to objects that THREE.js can raycast, the solid lines that get their geometry in the shader cannot be tested for intersection.

Note, if a [DataSource](./flywave-mapview.datasource.md) adds an \[\[Object3D\]\] to a [Tile](./flywave-mapview.tile.md)<!-- -->, it will be only pickable once has been called, this is because method creates the internal three.js root \[\[Object3D\]\] which is used in the \[\[PickHandler\]\] internally. This method will not test for intersection custom objects added to the scene by for example calling directly the \[\[scene.add\]\] method from THREE.