# useLongPress

Long-press on the map, implemented once with pointer events so it behaves
the same on every engine. A press fires after [`LONG_PRESS_DELAY_MS`](https://docs.mapcairn.com/api/map/LONG_PRESS_DELAY_MS.md)
unless the pointer moves more than 10 CSS pixels, a second
pointer joins (pinch), the pointer is released or cancelled, or the map
moves (`cancel`). Right-click fires it at once and suppresses the browser's
context menu.

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

## Signature

```ts
import { useLongPress } from "@mapcairn/map";
 
function useLongPress(options: UseLongPressOptions): UseLongPress;
```

## Parameters

- `options` (`UseLongPressOptions`)

## Returns

`UseLongPress`

## Remarks

Android raises `contextmenu` during a touch long-press as well, so a
 press fires at most once whichever comes first. Only the primary button
 starts a timed press.

## See also

- [`UseLongPressOptions`](https://docs.mapcairn.com/api/map/UseLongPressOptions.md)
- [`UseLongPress`](https://docs.mapcairn.com/api/map/UseLongPress-interface.md)

Source: [packages/map/src/host/useLongPress.ts:77](https://github.com/MapCairn/mapcairn/blob/main/packages/map/src/host/useLongPress.ts#L77)
