# MapCairnMapEventMap

The events a `<mapcairn-map>` sends, by name. Each is a `CustomEvent` that
bubbles, with what happened in `detail`. They carry
a prefix because a bare `click` is the browser's own.

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

## Signature

```ts
import type { MapCairnMapEventMap } from "@mapcairn/sdk/browser";
 
interface MapCairnMapEventMap
```

## Properties

### "mapcairn-click"

```ts
"mapcairn-click": CustomEvent<LatLng>;
```

The map was clicked or tapped: `detail` is the position.

### "mapcairn-error"

```ts
"mapcairn-error": CustomEvent<MapEngineError | MountMapError>;
```

Something went wrong: `detail` is a `MountMapError` when the map could not
be drawn from what the element was given, and a `MapEngineError` when the
engine failed.

### "mapcairn-feature-tap"

```ts
"mapcairn-feature-tap": CustomEvent<MapFeatureTap>;
```

A point, shape or line of a layer was tapped.

### "mapcairn-notice-action"

```ts
"mapcairn-notice-action": CustomEvent<NoticeAction>;
```

The button of a notice the page worded was pressed: `detail.notice` names
it. Sent only for the action of `engineNotice`, and what it does, such as
reloading the page, is the page's to decide. `detail.notice` is a text, and
`"engine"` is the one known today, so a listener needs a default for
another. In releases after `0.2.0`, not in `0.2.0` or any earlier release.

### "mapcairn-view-change"

```ts
"mapcairn-view-change": CustomEvent<ViewState>;
```

The map stopped moving: `detail` is the view it now shows.

## See also

- [`LatLng`](https://docs.mapcairn.com/api/sdk/browser/LatLng.md)
- [`MapEngineError`](https://docs.mapcairn.com/api/sdk/browser/MapEngineError.md)
- [`MountMapError`](https://docs.mapcairn.com/api/sdk/browser/MountMapError.md)
- [`MapFeatureTap`](https://docs.mapcairn.com/api/sdk/browser/MapFeatureTap.md)
- [`NoticeAction`](https://docs.mapcairn.com/api/sdk/browser/NoticeAction.md)
- [`ViewState`](https://docs.mapcairn.com/api/sdk/browser/ViewState.md)

Source: [packages/sdk/src/browser/element/types.ts:32](https://github.com/MapCairn/mapcairn/blob/main/packages/sdk/src/browser/element/types.ts#L32)
