> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
