# UseSearchOptions

Options for [`useSearch`](https://docs.mapcairn.com/api/map/useSearch-function.md).

This is an interface exported by `@mapcairn/map`, checked against version 0.2.0.

## Signature

```ts
import type { UseSearchOptions } from "@mapcairn/map";
 
interface UseSearchOptions
```

## Properties

### getBias

```ts
readonly getBias?: () => Bounds | undefined;
```

Returns the box to favour results inside, usually the visible map. Called
once when each search starts, so the bias follows the map without the
caller recomputing it on every frame. Leave it out to send only the
query: a host that passes it sends that box to its geocoder with every
search, which can show where the person is, so its privacy text must say so.

### onPick

```ts
readonly onPick?: (result: SearchResult) => boolean;
```

Takes the result when a search finds exactly one place, so Enter goes
straight to it instead of opening a list of one. The box then shows the
place's label with nothing to choose, and the announcement says where the
map went, not how many results there were. It returns `false` to decline
(the person has moved on from the box, say), and the result then shows as
a list. Several results always become a list, and without this option a
single result does too.

## See also

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

Source: [packages/map/src/tools/SearchPill/useSearch.ts:38](https://github.com/MapCairn/mapcairn/blob/main/packages/map/src/tools/SearchPill/useSearch.ts#L38)
