# editHandlesFor

The handles the person can drag on the selected shape: a vertex at each
position, a midpoint on each edge of a finished line or polygon (pressing
one adds a vertex there), and for a circle a radius handle due east of its
centre. Only the selected shape has handles, so a map full of shapes is
not full of targets.

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

## Signature

```ts
import { editHandlesFor } from "@mapcairn/core";
 
function editHandlesFor(shapes: readonly DrawShape[], selection: DrawSelection | null, projection?: MapProjection): MapEditHandle[];
```

## Parameters

- `shapes` (`readonly DrawShape[]`)
- `selection` (`DrawSelection | null`)
- `projection?` (`MapProjection`)

## Returns

`MapEditHandle[]`

## Remarks

Ids are `<shape>:v:<index>`, `<shape>:m:<index>` (the vertex that
 would be inserted at that index) and `<shape>:r`; read them with
 [`parseHandleId`](https://docs.mapcairn.com/api/core/parseHandleId.md). A midpoint sits on its edge as the overlay draws
 it for the map's `projection` (flat, the default, or globe).

## See also

- [`DrawShape`](https://docs.mapcairn.com/api/core/DrawShape.md)
- [`DrawSelection`](https://docs.mapcairn.com/api/core/DrawSelection.md)
- [`MapProjection`](https://docs.mapcairn.com/api/core/MapProjection.md)
- [`MapEditHandle`](https://docs.mapcairn.com/api/core/MapEditHandle.md)

Source: [packages/core/src/draw/handles.ts:66](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/draw/handles.ts#L66)
