> For the complete documentation index, see [llms.txt](https://developers.felt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.felt.com/js-sdk-api-reference/interactions/interactionscontroller.md).

# InteractionsController

***

The Interactions controller allows you to observe interactions with the map

## Extended by

* [`FeltController`](/js-sdk-api-reference/main/feltcontroller.md)

## Events

### onPointerClick()

> **onPointerClick**(`params`: { `handler`: (`event`: [`MapInteractionEvent`](/js-sdk-api-reference/interactions/mapinteractionevent.md)) => `void`; }): `VoidFunction`

Allows you to be notified when the user clicks on the map.

Use this to react to user clicks on the map, such as triggering custom actions or collecting interaction data.

#### Parameters

| Parameter        | Type                                                                                                                    |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `params`         | { `handler`: (`event`: [`MapInteractionEvent`](/js-sdk-api-reference/interactions/mapinteractionevent.md)) => `void`; } |
| `params.handler` | (`event`: [`MapInteractionEvent`](/js-sdk-api-reference/interactions/mapinteractionevent.md)) => `void`                 |

#### Returns

`VoidFunction`

A function to unsubscribe from the listener.

#### Example

```typescript
const unsubscribe = felt.onPointerClick({
  handler: (event) => console.log(event.center, event.features),
});

// later on...
unsubscribe();
```

***

### onPointerMove()

> **onPointerMove**(`params`: { `handler`: (`event`: [`MapInteractionEvent`](/js-sdk-api-reference/interactions/mapinteractionevent.md)) => `void`; }): `VoidFunction`

Allows you to be notified when the user moves the mouse over the map.

Use this to track mouse movement and detect features under the cursor, such as for hover effects or real-time data display.

#### Parameters

| Parameter        | Type                                                                                                                    | Description             |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `params`         | { `handler`: (`event`: [`MapInteractionEvent`](/js-sdk-api-reference/interactions/mapinteractionevent.md)) => `void`; } | Params for the listener |
| `params.handler` | (`event`: [`MapInteractionEvent`](/js-sdk-api-reference/interactions/mapinteractionevent.md)) => `void`                 | The handler function    |

#### Returns

`VoidFunction`

A function to unsubscribe from the listener.

#### Example

```typescript
// Track mouse movement and features under cursor
const unsubscribe = felt.onPointerMove({
  handler: (event) => {
    console.log("Mouse position:", event.center);
    console.log("Features under cursor:", event.features);
  }
});

// later on...
unsubscribe();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.felt.com/js-sdk-api-reference/interactions/interactionscontroller.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
