# hitTestHandle

The handle a press at `at` lands on: the nearest within `tolerancePx`. At
equal distance a vertex beats a radius handle, which beats a midpoint, and
the later handle (drawn on top) beats an earlier one. Both map adapters use
this, so a press means the same thing on either.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { hitTestHandle } from "@mapcairn/core";
 
function hitTestHandle(handles: readonly ProjectedHandle[], at: PixelPoint, tolerancePx: number): ProjectedHandle | null;
```

## Parameters

- `handles` (`readonly ProjectedHandle[]`)
- `at` (`PixelPoint`)
- `tolerancePx` (`number`)

## Returns

`ProjectedHandle | null`

## See also

- [`ProjectedHandle`](https://docs.mapcairn.com/api/core/ProjectedHandle.md)
- [`PixelPoint`](https://docs.mapcairn.com/api/core/PixelPoint.md)

Source: [packages/core/src/draw/hit.ts:50](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/draw/hit.ts#L50)
