> 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/embed-options.md).

# Embed options

`Felt.embed()` takes an optional third argument that controls how the embedded map looks and behaves:

```typescript
const felt = await Felt.embed(container, FELT_MAP_ID, {
  uiControls: {
    showLegend: false,
    cooperativeGestures: false,
  },
  initialViewport: {
    center: { latitude: 40.7128, longitude: -74.006 },
    zoom: 10,
  },
});
```

## UI controls

All `uiControls` options are booleans:

| Option                | Default | Description                                                                                                                                                                                                                           |
| --------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `showLegend`          | `true`  | Whether the legend is shown.                                                                                                                                                                                                          |
| `cooperativeGestures` | `true`  | Adjusted gesture behavior for embeds: on mobile, one-finger drag scrolls the page while two fingers pan the map; on desktop, scroll-to-zoom requires holding Ctrl/Cmd. Disable for app-like embeds where the map is the main content. |
| `fullScreenButton`    | `true`  | Shows a button that opens the map in a new tab or window.                                                                                                                                                                             |
| `geolocation`         | `false` | Shows a geolocation button that plots and tracks the visitor's position.                                                                                                                                                              |
| `zoomControls`        | `true`  | Shows the zoom controls (bottom right). Hiding them does not prevent zooming.                                                                                                                                                         |
| `scaleBar`            | `true`  | Shows the scale bar.                                                                                                                                                                                                                  |
| `rotation`            | `true`  | Allows the map to be rotated (right-drag or Ctrl-drag, two-finger rotate, keyboard shortcuts) and shows the compass.                                                                                                                  |
| `contextMenu`         | `true`  | Allows the right-click context menu. When `false`, right-clicking opens neither Felt's menu nor the browser's.                                                                                                                        |

You can change these after the map has loaded with [`updateUiControls`](https://developers.felt.com/js-sdk-api-reference/ui/uicontroller#updateuicontrols):

```typescript
felt.updateUiControls({ showLegend: false });
```

## Initial viewport

`initialViewport` overrides the map's saved viewport with a center and zoom for this embed:

```typescript
initialViewport: {
  center: { latitude: 40.7128, longitude: -74.006 },
  zoom: 10,
}
```

## Embedding private maps

Public and unlisted maps embed with no extra configuration. To show a **private** map to visitors who don't have a Felt account, mint an embed token on your server and pass it as the `token` option:

```typescript
const felt = await Felt.embed(container, FELT_MAP_ID, {
  token: embedTokenFromYourServer,
});
```

Embed tokens are part of the [Platform add-on](/plans-access-and-limits.md#platform). They last 12 hours and are scoped to a single map. See [Authenticated embeds](/js-sdk/authenticated-embeds.md) for the server code, how authorization works, and how to serve each customer their own data.


---

# 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/embed-options.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.
