For the complete documentation index, see llms.txt. This page is also available as Markdown.

Extensions

Describe an interactive tool and Felt AI builds it as a custom extension on your map, such as a panel that responds to clicks.

Add an extension to give people interactive tools on your map, such as a panel that responds to clicks or a filter they draw. Describe what you want the extension to do, and Felt AI generates the code. Felt hosts the extension with the map.

Anyone viewing the map can use an extension, without a seat or extra access.

What a custom extension can do

A custom extension can do anything the JavaScript SDK supports on the map where it runs. For example, it can:

  • Respond when someone clicks a feature, draws a shape, or moves the map.

  • Read features and their attributes from the map's layers.

  • Show, hide, filter, and restyle layers.

  • Draw temporary lines, points, or areas, which aren't saved to the map's layers.

  • Add panels, buttons, dropdowns, and text inputs to the map.

  • Request data from other web services.

Felt has no built-in story maps, saved views, bookmarks, or tours, but a custom extension or the JavaScript SDK can build a story-map-like experience.

Custom extensions run in a sandbox: a web worker in the browser of each person viewing the map. Extension code has no window or document, can't access the surrounding page, and can't call the Felt REST API as that person. The REST API can't add extensions to a map.

You can load third-party JavaScript libraries, such as Turf for spatial calculations, from a URL with importScripts. Libraries that draw into the page, such as most charting and mapping libraries, don't work. Build panels and controls with the JavaScript SDK instead.

Examples

Neighborhood comparison

A panel compares two neighborhoods.

Neighborhood Comparison panel comparing Nob Hill and North Beach in San Francisco, with land use parcels shaded on the map.

River animation

The Mississippi River network glows at a speed you set.

Mississippi River Basin animation panel with an Animation Speed setting, and the river network glowing on a dark map.

Commuter flows

Clicking a county draws lines to its commuters' destinations.

Lines from Cook County, Illinois, to commuter destination counties, with a panel of commuters by mode, travel mode, and flow direction.

Create a custom extension with Felt AI

  1. On the map, click Edit map.

  2. In the toolbar, click Developer Platform > Custom extension. The Extension editor opens.

  3. In the Felt AI tab, describe what the extension should do and press Enter. Felt AI writes the code.

  4. Click Run. The Preview shows the map with the extension running.

  5. Optional: Ask Felt AI for changes or edit the code yourself, then click Run again.

  6. Optional: In the name field at the top of the code editor, enter a name.

  7. Click Save. The extension appears in the Extensions section of the legend.

Example descriptions:

  • "When someone clicks a point, show a popup with the nearest 3 schools."

  • "Create a story map about the seven wonders of the world."

For more ways to phrase a request, see Prompting tips.

If the extension has errors, click the Felt AI tab, then Fix errors. The Console tab shows every log and error from the preview.

Extension editor with the code editor at the top left, the Felt AI and Console tabs below it, and the Preview map on the right.

Where extensions run

Extensions run in view mode, including in embeds and on public maps. In edit mode, they're listed but inactive. Click Done to try one, or use the Extension editor's Preview.

Manage extensions

In edit mode, click an extension in the Extensions section of the legend to edit it, or drag it to change its position in the list. The ··· menu on an extension has Copy, Duplicate, and Delete. To reuse a custom extension on another map, click Copy, open the other map in edit mode, and press Cmd+V (Mac) or Ctrl+V (Windows).

Built-in map tools

Search, Measure, Table, and Compare are tools every map has, not extensions.

Last updated

Was this helpful?