arrow-left

Only this pageAll pages
gitbookPowered by GitBook
triangle-exclamation
Couldn't generate the PDF for 226 pages, generation stopped at 100.
Extend with 50 more pages.
1 of 100

JS SDK API Reference

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

API Reference

To get started:

View FeltController for a complete list of available functions. FeltEmbedOptions enumerates initialization options.

hashtag
Documents

hashtag
Modules

import { Felt } from "@feltmaps/js-sdk";

const felt = await Felt.embed(
  document.querySelector("#container"),
  "FELT_MAP_ID",
  {
    uiControls: {
      cooperativeGestures: false,
      fullScreenButton: false,
      showLegend: false,
    },
  }
);
const layers = await map.getLayers();
  • CHANGELOG
    Basemaps
    Elements
    Interactions
    Layers
    Main
    Misc
    Selection
    Shared
    Tools
    UI
    Viewport

    GridType


    GridType: "h3"

    The type of grid to use for precomputed aggregate values.

    AggregationMethod


    AggregationMethod: "min" | "max" | "avg" | "sum" | "median"

    The method to use for the aggregation.

    Basemaps


    The Basemaps module allows you to control the map's basemap layer, such as getting the current basemap, listing available basemaps, changing the basemap, and being notified when the basemap changes.

    hashtag
    Controller

    • BasemapsController

    hashtag
    Interfaces

    hashtag
    Type Aliases

    ElementGroup


    hashtag
    Properties

    hashtag
    id

    CustomTileBasemap


    hashtag
    Properties

    hashtag
    id

    ColorBasemapInput


    ColorBasemapInput: Omit<, "id">

    GetElementsConstraint


    The constraints to apply when getting elements.

    hashtag
    Properties

    hashtag

    AggregationConfig


    Defines how to aggregate a value across features in a layer.

    hashtag
    Properties

    hashtag

    Layer


    Layer: | |

    FeltTiledVectorSource


    FeltTiledVectorSource: { type: "felt"; tileTemplateUrl: string; }

    A tiled vector source is a layer that is populated from data the has been uploaded to Felt, and processed into vector tiles.

    GetLayerHistogramBin


    One bin from the response from the method.

    hashtag
    Properties

    hashtag

    GridConfig


    GridConfig: |

    Describes the type of grid to use for precomputed aggregate values.

    GetRenderedFeaturesConstraint


    Constraints for the method. This can include layer constriants, spatial constraints, or both. If no constraints are provided, all rendered features will be returned.

    hashtag
    Properties

    hashtag

    GeoJsonDataVectorSource


    A GeoJSON data source is a layer that is populated from GeoJSON data, such as from a local file, or programmatically-created data.

    hashtag
    Properties

    hashtag

    FilterExpression


    FilterExpression: [null | string, "in" | "ni", null | (null | string | number | boolean)[]] | [null

    AggregatedGridConfig


    The grid configuration for an aggregated precomputed aggregate value. This requires an attribute property, because the numeric aggregation requires it.

    If you just want to count the features in each grid cell, use the instead, where you are not required to specify an attribute.

    Used inside .

    hashtag

    id: string

    A string identifying the element group.


    hashtag
    name

    name: string

    The name of the element group. This is shown in the legend.


    hashtag
    caption

    caption: null | string

    The caption of the element group. This is shown in the legend.


    hashtag
    elementIds

    elementIds: string[]

    The ids of the elements in the element group.

    hashtag
    Remarks

    You can use these ids to get the full element objects via the `getElements` method.


    hashtag
    visible

    visible: boolean

    Whether the element group is visible or not.


    hashtag
    shownInLegend

    shownInLegend: boolean

    Whether the element group is shown in the legend or not.

    id: string

    A unique identifier for the basemap.

    hashtag
    Remarks

    Do not rely on the stability of this ID for Felt basemaps, as they are subject to change.


    hashtag
    name

    name: string

    The name of the basemap.


    hashtag
    uiColorScheme

    uiColorScheme: "light" | "dark"

    The color scheme of the UI that goes with the basemap. It is best to set this to "light" if your basemap is broadly light, and "dark" if your basemap is broadly dark.


    hashtag
    type

    type: "xyz_tile"


    hashtag
    tileUrl

    tileUrl: string


    hashtag
    attribution?

    optional attribution: string

    The attribution of the basemap, which is shown in the map's UI.

    ids?

    optional ids: string[]

    The ids of the elements to get.

    attribute

    attribute: string

    The attribute to use for the aggregation. This must be a numeric attribute.


    hashtag
    method

    method: "min" | "max" | "avg" | "sum" | "median"

    The method to use for the aggregation.

    hashtag
    Type declaration

    hashtag
    type

    type: "felt"

    Identifies this as a tiled vector source. Typically, these tiles will have been uploaded to and processed by Felt.

    hashtag
    tileTemplateUrl

    tileTemplateUrl: string

    The template URL used for fetching tiles.

    type

    type: "geoJsonData"

    Identifies this as a GeoJSON data source.


    hashtag
    data

    data: object

    The GeoJSON data for the layer.

    This must be a GeoJSON FeatureCollection.

    |
    string
    ,
    "lt"
    |
    "gt"
    |
    "le"
    |
    "ge"
    |
    "eq"
    |
    "ne"
    |
    "cn"
    |
    "nc"
    |
    "is"
    |
    "isnt"
    ,
    null
    |
    string
    |
    number
    |
    boolean
    ]
    FeltBasemap
    ColorBasemap
    CustomTileBasemap
    ColorBasemapInput
    CustomTileBasemapInput
    Basemap
    ColorBasemap
    RasterLayer
    VectorLayer
    DataOnlyLayer
    min

    min: number

    The left edge of the bin.


    hashtag
    max

    max: number

    The right edge of the bin.


    hashtag
    value

    value: number

    The number of features in the bin.

    LayersController.getHistogramData
    CountGridConfig
    AggregatedGridConfig
    areaQuery?

    optional areaQuery: { coordinates: LatLng; } | { boundary: [number, number, number, number]; }

    The area to query for rendered features. This can be specific coordinates or a FeltBoundary. If omitted, the entire viewport will be queried.


    hashtag
    layerIds?

    optional layerIds: string[]

    The ids of the layers to get rendered features for.

    `getRenderedFeatures`
    Properties

    hashtag
    resolution

    resolution: number

    The resolution of the grid to use for the precomputed calculation.


    hashtag
    attribute

    attribute: string

    The attribute to use for the precomputed calculation.

    This must be a numeric attribute;


    hashtag
    type

    type: "h3"

    The type of grid to use for the precomputed calculation.


    hashtag
    method

    method: "min" | "max" | "avg" | "sum"

    The method to use for the precomputed calculation.

    CountGridConfig
    GetLayerPrecomputedCalculationParams

    CountGridConfig


    The grid configuration for a count-based precomputed aggregate value. Compared to the AggregatedGridConfig, the attribute property is not required, because the count is the same regardless of the attribute.

    Used inside GetLayerPrecomputedCalculationParams.

    hashtag
    Properties

    hashtag
    resolution

    resolution: number

    The resolution of the grid to use for the precomputed calculation.


    hashtag
    type

    type: "h3"

    The type of grid to use for the precomputed calculation.


    hashtag
    method

    method: "count"

    The method to use for the precomputed calculation, which in this case is always "count".

    FeltBasemap


    hashtag
    Properties

    hashtag
    id

    id: string

    A unique identifier for the basemap.

    hashtag
    Remarks

    Do not rely on the stability of this ID for Felt basemaps, as they are subject to change.


    hashtag
    name

    name: string

    The name of the basemap.


    hashtag
    uiColorScheme

    uiColorScheme: "light" | "dark"

    The color scheme of the UI that goes with the basemap. It is best to set this to "light" if your basemap is broadly light, and "dark" if your basemap is broadly dark.


    hashtag
    type

    type: "felt"


    hashtag
    theme

    theme: "color_light" | "monochrome_dark" | "monochrome_light" | "satellite"


    hashtag
    attribution?

    optional attribution: string

    The attribution of the basemap, which is shown in the map's UI.

    GeoJsonFileVectorSource


    A GeoJSON file source is a layer that is populated from a GeoJSON file on your local machine.

    This is an input-only type. It is converted to a GeoJsonDataVectorSource when passed to LayersController.createLayersFromGeoJson.

    hashtag
    Properties

    hashtag
    type

    type: "geoJsonFile"

    Identifies this as a GeoJSON file source.


    hashtag
    file

    file: File

    The GeoJSON file for the layer.

    GeoJsonUrlVectorSource


    A GeoJSON URL source is a layer that is populated from a GeoJSON file at a remote URL.

    These sources are ones that have not been uploaded to and processed by Felt, and as such their capabilities are limited.

    For instance, they cannot be filtered, nor can statistics be fetched for them.

    hashtag
    Properties

    hashtag
    type

    type: "geoJsonUrl"

    Identifies this as a GeoJSON URL source.


    hashtag
    url

    url: string

    The remote URL of the GeoJSON file used to populate the layer.


    hashtag
    refreshInterval?

    optional refreshInterval: null | number

    The interval in milliseconds between automatic refreshes of the GeoJSON.

    The value must be in the range of 250ms - 5 minutes (300,000ms).

    If the value is null, the GeoJSON will not be refreshed automatically.

    LegendItemIdentifier


    The identifier for a legend item. It is a compound key of the layer to which the legend item belongs and the legend item's own id.

    hashtag
    Properties

    hashtag
    id

    id: string

    The id of the legend item.


    hashtag
    layerId

    layerId: string

    The id of the layer the legend item belongs to.

    GeometryFilter


    GeometryFilter: FeltBoundary | PolygonGeometry | MultiPolygonGeometry | LngLatTuple[]

    The common type for filtering data by a spatial boundary.

    This can be either:

    • FeltBoundary: a [w, s, e, n] bounding box

    • PolygonGeometry: a GeoJSON Polygon geometry

    • MultiPolygonGeometry: a GeoJSON MultiPolygon geometry

    • LngLatTuple[]: a list of coordinates describing a single ring of a polygon

    LayerProcessingStatus


    LayerProcessingStatus: "processing" | "completed" | "failed" | "incomplete"

    This describes the processing status of a layer.

    The various values are:

    • processing: The layer has been uploaded or updated and is still processing.

    • completed: The layer has been processed and can be viewed on the map.

    • failed: The layer failed to process and cannot be viewed on the map.

    • incomplete: The layer has not been processed.

    GetLayersConstraint


    The constraints to apply when getting layers.

    hashtag
    Properties

    hashtag
    ids?

    optional ids: string[]

    The ids of the layers to get.

    Element


    Element: PlaceElementRead | PathElementRead | PolygonElementRead | CircleElementRead | MarkerElementRead | HighlighterElementRead | TextElementRead | NoteElementRead | ImageElementRead | LinkElementRead

    GetLayerCategoriesGroup


    A single category from the response from the LayersController.getCategoryData method.

    hashtag
    Properties

    hashtag
    key

    key: string | number | boolean

    The category for which the value was calculated.


    hashtag
    value

    value: null | number

    The value calculated for the category, whether a count, sum, average, etc.

    null is returned if there are no features in the category as opposed to zero, so as not to confuse with a real zero value from some aggregation.

    ElementCreate


    ElementCreate: PlaceElementCreate | PathElementCreate | PolygonElementCreate | CircleElementCreate | MarkerElementCreate | HighlighterElementCreate | ImageElementCreate | TextElementCreate | NoteElementCreate

    FilterLogicGate


    FilterLogicGate: "and" | "or"

    ImageElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    type

    type: "Image"


    hashtag
    imageUrl

    imageUrl: string

    The URL of the image that is rendered in this element


    hashtag
    opacity

    opacity: number

    The opacity of the image, between 0 and 1.

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    LayerChangeCallbackParams


    The parameters for the `onLayerChange` listener.

    hashtag
    Properties

    hashtag
    layer

    layer: null |

    The new data for the layer or null if the layer was removed.

    LegendItemChangeCallbackParams


    The parameters for the `onLegendItemChange` listener.

    hashtag
    Properties

    hashtag
    legendItem

    legendItem: null |

    The new data for the legend item or null if the legend item was removed.

    LegendDisplay


    LegendDisplay: "default" | "nameOnly"

    Describes how the layer is displayed in the legend.

    There are two display modes:

    1. Default:

      • Shows layer name and caption

      • Shows representation of the layer's viz (e.g. color swatches, proportional symbols)

    1. Name-only (compact display):

      • Shows only layer name and caption

      • Hides representation of the layer's viz

    ElementGroupChangeCallbackParams


    The parameters for the `onElementGroupChange` listener.

    hashtag
    Properties

    hashtag
    elementGroup

    elementGroup: null |

    Interactions


    The Interactions module allows you to be notified when the user interacts with the map.

    Interactions include clicking and hovering on points and features.

    hashtag
    Controller

    hashtag
    Interfaces

    @feltmaps/js-sdk

    hashtag
    1.10.0

    hashtag
    Minor Changes

    NoteElementCreate


    hashtag
    Properties

    hashtag
    type

    ColorBasemap


    hashtag
    Properties

    hashtag
    id

    LayerGroup


    hashtag
    Properties

    hashtag
    id

    ImageElementUpdate


    hashtag
    Properties

    hashtag
    id

    LayerGroupChangeCallbackParams


    The parameters for the listener.

    hashtag
    Properties

    hashtag

    ElementChangeCallbackParams


    The parameters for the and the listeners.

    hashtag
    Properties

    hashtag

    LayerSchemaDateTimeAttribute


    The schema for a datetime attribute on a layer.

    hashtag
    Properties

    hashtag

    GetLayerPrecomputedCalculationParams


    The parameters for calculating a single aggregate value for a layer, passed to the method.

    hashtag
    Properties

    hashtag

    FilterTernary


    FilterTernary: [ | | null | boolean, , | | null | boolean]

    A FilterTernary is a tree structure for combining expressions with logical operators.

    When combining three or more conditions, you must use proper nesting rather than a flat list.

    LayerFilters


    The filters that are currently set on a layer.

    A layer's filters are the combination of various different places in which filters can be applied.

    hashtag
    Properties

    GetLayerCategoriesParams


    The parameters for getting categories from a layer, passed to the method.

    hashtag
    Properties

    hashtag

    GetElementGroupsConstraint


    The constraints to apply when getting element groups.

    hashtag
    Properties

    hashtag

    LegendItem


    A legend item, which often represents a sub-class of features in a layer in the case of categorical or classed layers.

    hashtag
    Properties

    hashtag

    LayerSchemaTextAttribute


    The schema for a text attribute on a layer.

    hashtag
    Properties

    hashtag

    ElementUpdate


    ElementUpdate: | | | | | | | |

    LayerSchemaBooleanAttribute


    The schema for a boolean attribute on a layer.

    hashtag
    Properties

    hashtag

    LayerSchemaDateAttribute


    The schema for a date attribute on a layer.

    hashtag
    Properties

    hashtag

    LayerSchema


    The schema that describes the structure of the features in a layer.

    hashtag
    Remarks

    This can be useful to build generic UIs that need to know the structure of the data in a layer, such as a dropdown to choose an attribute.

    CustomTileBasemapInput


    CustomTileBasemapInput: Omit<, "id">

    Basemap


    Basemap: | |

    03be185: Add basemaps API

  • 34b9ed3: Add feature actions

  • f7a1b4b: Add pageSize and select to getFeatures

  • 3d9527b: Add duplicateLayer method

  • hashtag
    Patch Changes

    • 6e233c6: Fix feature action types and documentation

    hashtag
    1.9.0

    hashtag
    Minor Changes

    • 7e4034f: Add support for legendDisplay on the layer

    hashtag
    1.8.0

    hashtag
    Minor Changes

    • 336538b: Improve controller method documentation

    hashtag
    Patch Changes

    • 7b04db4: Update filter docs

    hashtag
    1.7.0

    hashtag
    Minor Changes

    • f40a75c: Update getPrecomputedAggregates types

    • 4c4ebfd: Add UIIframeElement to custom ui panel

    • b87393f: Better docs, types and method consistency for Custom Panels API

    • aff926a: Return UIPanel on custom panel API methods

    • f5ca219: Speed up initial Felt/SDK connection

    • 0b06e28: Add support for align and distribute items on grid container

    • bd1952f: Merge create and update panel methods and require using createPanelId

    • 27cc597: Add UIGridContainerElement to custom ui panel

    • f2fcd2a: Add checkbox, radio and toggle controls to custom ui panel

    • 15a35a5: Add method getPrecomputedAggregates

    • 6ce4a76: Rename UIPanel onClose to onClickClose

    • c16c55a: Support disabled on custom ui control option

    • 2688f9c: Add UIButtonRowElement to custom ui panel

    • 49d8895: Add Custom UI API for action triggers

    • 0754363: Add new variants, drop thin variants and add tint prop to UIButtonElement

    • 535e539: Include element id on every custom ui callback args

    • b848937: Add tool setting to hide/show inspector

    • 1e8e6f1: Return UIActionTrigger on custom action trigger API methods

    • 2b0f08f: Add Custom UI API for panels

    • f73dccf: Remove UIButtonGroupElement from custom ui panel

    hashtag
    Patch Changes

    • 58bd6dd: Add isDeterministicId to LayerFeature

    • 07b27c6: Export bundled controller types file for consumption as single file

    • 41e1612: Update getAggregates examples to be correct

    • 475c98e: Update getAggregates + MultiAggregationConfig docs

    • ea5c7ff: Run patch on prepare, not install

    • 4c83cfe: Don't try to patch packages not in dev mode

    • 2008356: Documentation improvements

    • 2fd720d: Use singular for custom ui types

    • a1c6322: Make custom panel API consistent with other methods

    hashtag
    1.6.0

    hashtag
    Minor Changes

    • 160ca6d: Implement getFeatures method on LayersController

    • 6a1e536: Widen allowed boundary types

    • 56077be: Add setLayerBoundary, getLayerBoundaries, onLayerBoundaryChange

    hashtag
    1.5.1

    hashtag
    Patch Changes

    • ac68984: Update getLayerSchema example

    hashtag
    1.5.0

    hashtag
    Minor Changes

    • d327b46: Add afterCreation option in pin tool settings to control what happens after creating a Place

    • 6a66d40: Add updateLayer and expand createLayersFromGeoJson options

    • 6504fea: Change documentation for getElementGeoemtry to document Highlighter and Marker functionality, and allow holes in Highlighter geometry

    • cf6711e: Make programmatic element CRUD types more accurate

    • 4c83c60: Add programmatic element creation, editing and deletion

    • 46e8ddc: Add onElementChange and onElementDelete

    • 3e87812: Adds APIs to use Felt's drawing tools on read-only maps

    • d877a83: Add getFeature for getting a single feature as GeoJSON with full detail geometry

    • 7f1d6aa: Add "interaction" to element schema

    • cf1dd7c: Improve Text and Note types and docs

    • 1f6a386: Add getViewportConstraints and setViewportConstraints methods definition

    • b059b70: Add onLayerFiltersChange to allow listening to changes to layer filters, be it ephemeral, style or widget filters that changed.

    • 19b41ce: Improve createLayer API

    • c20e605: Add setLayerLegendVisibility and setLayerGroupLegendVisibility methods definition

    • cbfd3fd: Reject promises when method handlers are invalid

    • 0915f48: Add showLayerDataTable and hideLayerDataTable methods

    • 9620df9: Change Circle.coordinates for Circle.center

    • 63c3042: Add getLayerSchema method

    • 69cc0a9: Fix spelling mistake in types

    • 87304d8: Fix geometry filter type

    • 1f22654: Add screen point to pointer events

    • b0e4149: Improves type readability and docs

    • 65bf269: Add createLayer and deleteLayer

    • 4bd0ae9: Add getMapDetails method definition

    • 5f903fb: Update Layer type and createLayerFromGeoJson to separate out Source concept

    • 597a8d6: Return coordinates on Circle and Place elements as they are only a single point.

    • f2f4289: Add layer stats methods

    hashtag
    Patch Changes

    • 993fd44: Allow workers to be SDK clients

    • 417b8f4: Fixes incorrect value in documentation and updates links to other methods

    • 9620df9: Improve element docs

    • f0892c4: Improve documentation

    • bb79037: Fix per-geometry styling for created layers

    hashtag
    1.4.0

    hashtag
    Minor Changes

    • 555a25a: Add clearSelection method

    • 1f5d950: Add option to pass auth token when embedding

    hashtag
    1.3.0

    hashtag
    Minor Changes

    • 4bbde62: Allow setting a note to show with layer filters

    hashtag
    1.2.0

    hashtag
    Minor Changes

    • 7badd4b: Add onMapIdle event

    • 41efd53: Add selectFeature method to select feature by layer and feature ID

    • 208c492: Add areaQuery param to getRenderedFeatures

    hashtag
    1.1.0

    hashtag
    Minor Changes

    • 5f607ec: Return style with layers, and allow updating layer styles via setLayerStyle

    hashtag
    Patch Changes

    • 3a8bec8: Fix API reference link in README

    hashtag
    1.0.2

    hashtag
    Major Changes

    • Release v1 of Felt JS SDK

    id: string

    A unique identifier for the basemap.

    hashtag
    Remarks

    Do not rely on the stability of this ID for Felt basemaps, as they are subject to change.


    hashtag
    name

    name: string

    The name of the basemap.


    hashtag
    uiColorScheme

    uiColorScheme: "light" | "dark"

    The color scheme of the UI that goes with the basemap. It is best to set this to "light" if your basemap is broadly light, and "dark" if your basemap is broadly dark.


    hashtag
    type

    type: "color"


    hashtag
    color

    color: string


    hashtag
    attribution?

    optional attribution: string

    The attribution of the basemap, which is shown in the map's UI.

    id: string

    A string identifying the layer group.


    hashtag
    name

    name: string

    The name of the layer group. This is shown in the legend.


    hashtag
    caption

    caption: null | string

    The caption of the layer group. This is shown in the legend.


    hashtag
    layerIds

    layerIds: string[]

    The ids of the layers in the layer group.

    hashtag
    Remarks

    You can use these ids to get the full layer objects via the `getLayers` method.


    hashtag
    visible

    visible: boolean

    Whether the layer group is visible or not.


    hashtag
    shownInLegend

    shownInLegend: boolean

    Whether the layer group is shown in the legend or not.


    hashtag
    bounds

    bounds: null | [number, number, number, number]

    The bounding box of the layer group in [west, south, east, north] order.

    FeltBoundary

    id

    id: string

    The unique identifier for this attribute.

    This can be used to fetch statistics, categories, histograms etc. for this attribute via the LayersController.getCategoryData, LayersController.getHistogramData, and LayersController.getAggregates methods.


    hashtag
    displayName

    displayName: string

    The human-readable name of this attribute.


    hashtag
    detailedType

    detailedType: string

    The specific data type of this attribute, providing more detail than the basic type.

    For instance, a numeric attribute might be "INTEGER", "FLOAT, etc.


    hashtag
    distinctCount

    distinctCount: number

    The number of distinct values present for this attribute across all features.


    hashtag
    type

    type: "datetime"

    Indicates this is a datetime attribute.


    hashtag
    min

    min: string

    The earliest datetime present for this attribute in ISO8601 format.


    hashtag
    max

    max: string

    The latest datetime present for this attribute in ISO8601 format.


    hashtag
    sampleValues

    sampleValues: { value: string; count: number; }[]

    A representative sample of datetime values for this attribute and their frequency.

    Name
    Type

    value

    string

    count

    number

    hashtag
    style

    style: Filters

    Filters that are set in the layer's style. These are the lowest level of filters, and can only be set by editing the map.


    hashtag
    components

    components: Filters

    Filters that are set in the layer's components, which are interactive elements in the legend. These can be set by viewers for their own session, but their default value can be set by the map creator.


    hashtag
    ephemeral

    ephemeral: Filters

    Filters that are set ephemerally by viewers in their own session.

    These are the filters that are set when the `setLayerFilters` method is called. There is no way to set these in the Felt UI - they can only be set using the SDK.


    hashtag
    combined

    combined: Filters

    The combined result of all the filters set on the layer.

    ids?

    optional ids: string[]

    The ids of the element groups to get.

    title

    title: string | string[]

    The title of the legend item.


    hashtag
    titleDependsOnZoom

    titleDependsOnZoom: boolean

    Whether the title depends on the zoom level or not. If it does, you need to call `getLegendItem` when the zoom level changes.

    Note that as the zoom level changes, the `onLegendItemChange` handler will not be called, so you need to call `getLegendItem` yourself.


    hashtag
    visible

    visible: boolean

    Whether the legend item is visible or not.


    hashtag
    id

    id: string

    The id of the legend item.


    hashtag
    layerId

    layerId: string

    The id of the layer the legend item belongs to.

    id

    id: string

    The unique identifier for this attribute.

    This can be used to fetch statistics, categories, histograms etc. for this attribute via the LayersController.getCategoryData, LayersController.getHistogramData, and LayersController.getAggregates methods.


    hashtag
    displayName

    displayName: string

    The human-readable name of this attribute.


    hashtag
    detailedType

    detailedType: string

    The specific data type of this attribute, providing more detail than the basic type.

    For instance, a numeric attribute might be "INTEGER", "FLOAT, etc.


    hashtag
    distinctCount

    distinctCount: number

    The number of distinct values present for this attribute across all features.


    hashtag
    type

    type: "text"

    Indicates this is a text attribute.


    hashtag
    sampleValues

    sampleValues: { value: string; count: number; }[]

    A small sample of string values for this attribute and their frequency.

    Name
    Type

    value

    string

    count

    number

    id

    id: string

    The unique identifier for this attribute.

    This can be used to fetch statistics, categories, histograms etc. for this attribute via the LayersController.getCategoryData, LayersController.getHistogramData, and LayersController.getAggregates methods.


    hashtag
    displayName

    displayName: string

    The human-readable name of this attribute.


    hashtag
    detailedType

    detailedType: string

    The specific data type of this attribute, providing more detail than the basic type.

    For instance, a numeric attribute might be "INTEGER", "FLOAT, etc.


    hashtag
    distinctCount

    distinctCount: number

    The number of distinct values present for this attribute across all features.


    hashtag
    type

    type: "boolean"

    Indicates this is a boolean attribute.


    hashtag
    sampleValues

    sampleValues: { value: boolean; count: number; }[]

    A representative sample of boolean values for this attribute and their frequency.

    Name
    Type

    value

    boolean

    count

    number

    id

    id: string

    The unique identifier for this attribute.

    This can be used to fetch statistics, categories, histograms etc. for this attribute via the LayersController.getCategoryData, LayersController.getHistogramData, and LayersController.getAggregates methods.


    hashtag
    displayName

    displayName: string

    The human-readable name of this attribute.


    hashtag
    detailedType

    detailedType: string

    The specific data type of this attribute, providing more detail than the basic type.

    For instance, a numeric attribute might be "INTEGER", "FLOAT, etc.


    hashtag
    distinctCount

    distinctCount: number

    The number of distinct values present for this attribute across all features.


    hashtag
    type

    type: "date"

    Indicates this is a date attribute.


    hashtag
    min

    min: string

    The earliest date present for this attribute in truncated ISO8601 format (YYYY-MM-DD).


    hashtag
    max

    max: string

    The latest date present for this attribute in truncated ISO8601 format (YYYY-MM-DD).


    hashtag
    sampleValues

    sampleValues: { value: string; count: number; }[]

    A representative sample of date values for this attribute and their frequency.

    Name
    Type

    value

    string

    count

    number

    hashtag
    Properties

    hashtag
    featureCount

    featureCount: number

    The total number of features in the layer.


    hashtag
    attributes

    attributes: LayerSchemaAttribute[]

    Array of attribute schemas describing the properties available on features in this layer.

    Layer
    LegendItem
    ElementGroup
    InteractionsController
    MapInteractionEvent
    layerGroup

    layerGroup: null | LayerGroup

    `onLayerGroupChange`
    element

    element: null | Element

    The new data for the element or null if the element was removed.


    hashtag
    isBeingCreated

    isBeingCreated: boolean

    Whether or not this element is still being created by a drawing tool.

    For example, if the user begins drawing a polygon, they need to place multiple points until they've ultimately completed the polygon. All the time they are still placing points, this will be true.

    For elements that require text entry (such as Places, Text and Notes) this will be true all the time the user is typing text until the point at which the user finishes, by pressing Escape for example.

    If the user is editing an existing element, this will be false.

    For elements that are created programmatically, this will be false.

    `onElementChange`
    `onElementCreate`
    layerId

    layerId: string

    The ID of the layer to calculate an aggregate value for.


    hashtag
    gridConfig

    gridConfig: GridConfig

    The grid configuration to use for the precomputed calculation.


    hashtag
    filters?

    optional filters: Filters

    Attribute filters for the features to include when calculating the aggregate value.


    hashtag
    boundary?

    optional boundary: GeometryFilter

    The spatial boundary for the features to include when calculating the aggregate value.

    LayersController.getPrecomputedAggregates
    layerId

    layerId: string

    The ID of the layer to get categories from.


    hashtag
    attribute

    attribute: string

    The attribute to use for categorization.


    hashtag
    limit?

    optional limit: number

    The maximum number of categories to return.


    hashtag
    filters?

    optional filters: Filters

    Attribute filters for the features to include when calculating the categories.


    hashtag
    boundary?

    optional boundary: GeometryFilter

    The spatial boundary for the features to include when calculating the categories.


    hashtag
    values?

    optional values: ValueConfiguration

    Configuration for filtering and aggregating values while preserving the full set of categories in the results.

    This is particularly useful when you want to compare different subsets of data while maintaining consistent categories. For example:

    • Show all building types in a city, but only count recent buildings in each type

    • Keep all neighborhood categories but only sum up residential square footage

    Unlike top-level filters which affect both what categories appear AND their values, filters in this configuration only affect the values while keeping all possible categories in the results.

    LayersController.getCategoryData
    PlaceElementUpdate
    PathElementUpdate
    PolygonElementUpdate
    CircleElementUpdate
    MarkerElementUpdate
    HighlighterElementUpdate
    TextElementUpdate
    NoteElementUpdate
    ImageElementUpdate
    CustomTileBasemap
    FeltBasemap
    ColorBasemap
    CustomTileBasemap
    Default layer legend
    Default layer legend
    Name-only layer legend
    Name-only layer legend
    type: "Note"

    hashtag
    text

    text: string


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

    The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

    The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.

    When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    align?

    optional align: "center" | "left" | "right"

    The alignment of the text, either left, center or right.

    hashtag
    Default


    hashtag
    style?

    optional style: "light" | "italic" | "regular" | "caps"

    The style of the text, either italic, light, regular or caps.

    hashtag
    Default


    hashtag
    widthScale?

    optional widthScale: number


    hashtag
    position?

    optional position: LngLatTuple

    The geographical position of the center of the note element.

    If this is omitted, the note will be placed at the center of the current viewport.

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Image"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: [number, number][][] = MultiLineStringGeometrySchema.shape.coordinates


    hashtag
    imageUrl?

    optional imageUrl: string

    The URL of the image that is rendered in this element


    hashtag
    opacity?

    optional opacity: number

    The opacity of the image, between 0 and 1.

    hashtag
    Default

    hashtag
    Example
    FilterTernary
    FilterExpression
    FilterLogicGate
    FilterTernary
    FilterExpression
    // A simple filter with a single condition
    const filter = [
      ["AREA", "gt", 30_000],
      "and",
      ["COLOR", "eq", "red"]
    ]
    
    // A complex filter with multiple conditions
    const filter = [
      ["AREA", "gt", 30_000],
      "and",
      [
        ["COLOR", "eq", "red"],
        "or",
        ["TYPE", "eq", "residential"]
      ]
    ]
    1
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "default"
    1

    Elements


    The Felt SDK lets you read, create and update elements on the map.

    Elements that are created via the SDK are only available to the current session - they are not persisted to the map and not available to other users of the map.

    If you want to let your users create elements (as opposed to using the SDK to create them programmatically), you can use the ToolsController to select and configure the drawing tools in Felt.

    hashtag
    Controller

    hashtag
    Interfaces

    hashtag
    Type Aliases

    hashtag
    Element Groups

    hashtag
    Elements

    LinkElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    type

    type: "Link"


    hashtag
    url

    url: string

    The URL of the link that is rendered in this element.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    PathElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    imageUrl

    imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity

    strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth

    strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle

    strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    type

    type: "Path"


    hashtag
    distanceMarker

    distanceMarker: boolean

    Whether a distance marker is shown at the midpoint of the path.

    hashtag
    Default


    hashtag
    routingMode

    routingMode: null | "driving" | "cycling" | "walking" | "flying"

    Whether this represents a route, and if so, what mode of transport is used.

    If this is null, the path is not considered to be a route, so while it can have a distanceMarker, it will does not have a start or end cap.

    hashtag
    Default


    hashtag
    endCaps

    endCaps: boolean

    Whether or not to show Start and End caps on the path. This is only available if the routingMode is set.

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    MarkerElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Marker"


    hashtag
    coordinates

    coordinates: [][]


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the marker, between 0 and 1.

    hashtag
    Default


    hashtag
    size?

    optional size: number

    The size of the marker, used in conjunction with the zoom to determine the actual size of the marker.

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

    The zoom level at which the marker was created. This is combined with the size to determine the actual size of the marker.

    When creating a marker, if you don't supply this value it defaults to the current zoom of the map when you call createElement.

    TextElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Text"


    hashtag
    text

    text: string


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

    The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

    The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.

    When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    align?

    optional align: "center" | "left" | "right"

    The alignment of the text, either left, center or right.

    hashtag
    Default


    hashtag
    style?

    optional style: "light" | "italic" | "regular" | "caps"

    The style of the text, either italic, light, regular or caps.

    hashtag
    Default


    hashtag
    position?

    optional position:

    The geographical position of the center of the text element.

    If this is omitted, the text will be placed at the center of the current viewport.

    HighlighterElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Highlighter"


    hashtag
    coordinates

    coordinates: [][][]

    A multipolygon describing the area that is highlighted.

    If renderHoles is set to false, only the outer ring of each polygon will be rendered, filling in the area inside the highlighted region.


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    renderHoles?

    optional renderHoles: boolean

    Whether to render the holes of the highlighted area.

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the highlighter, between 0 and 1.

    hashtag
    Default

    PlaceElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Place"


    hashtag
    coordinates

    coordinates:


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    symbol?

    optional symbol: string

    The symbol that is rendered for the Place.

    This can be an emoji by using colon-enclosed characters (e.g. ":smiley:") or one of the symbols available in Felt's symbol library.

    You can see the available symbols in the Felt UI when editing a Place by hovering a symbol and converting the tooltip to kebab-case. For example, the "Oil barrel" symbol is oil-barrel.


    hashtag
    frame?

    optional frame: null | "frame-circle" | "frame-square"

    The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.


    hashtag
    hideLabel?

    optional hideLabel: boolean

    Whether the element's label is hidden on the map. This allows you to add a name to the element and can show in popups, but not have it visible on the map.

    This will also hide the faint placeholder label that is shown when an editable Place is selected.

    hashtag
    Default

    MarkerElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Marker"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the marker, between 0 and 1.

    hashtag
    Default


    hashtag
    size?

    optional size: number

    The size of the marker, used in conjunction with the zoom to determine the actual size of the marker.

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

    The zoom level at which the marker was created. This is combined with the size to determine the actual size of the marker.

    When creating a marker, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    coordinates?

    optional coordinates: [][]

    LayerBoundaries


    All the different sources for boundaries for a layer, including their combined result.

    hashtag
    Properties

    hashtag
    spatialFilters

    spatialFilters: null |

    Boundaries set by drawing spatial filters on the map.

    When there are multiple spatial filters, they are combined into a multi-polygon.


    hashtag
    ephemeral

    ephemeral: null |

    Boundaries that are set ephemerally by viewers in their own session.

    These are the filters that are set when the method is called. There is no way to set these in the Felt UI - they can only be set using the SDK.


    hashtag
    combined

    combined: null |

    The combined result of all the boundaries set on the layer.

    Each different source of boundary is intersected to produce the combined result.

    GetLayerCalculationParams


    The parameters for calculating a single aggregate value for a layer, passed to the LayersController.getAggregates method.

    hashtag
    Type Parameters

    Type Parameter

    T extends | "count"

    hashtag
    Properties

    hashtag
    layerId

    layerId: string

    The ID of the layer to calculate an aggregate value for.


    hashtag
    aggregation

    aggregation: <T>

    Specifies how to aggregate values within each category or bin. When omitted, features are counted. When specified, the chosen calculation (avg, sum, etc.) is performed on the specified attribute.


    hashtag
    filters?

    optional filters:

    Attribute filters for the features to include when calculating the aggregate value.


    hashtag
    boundary?

    optional boundary:

    The spatial boundary for the features to include when calculating the aggregate value.

    InteractionsController


    The Interactions controller allows you to observe interactions with the map

    hashtag
    Extended by

    NoteElementRead


    hashtag
    Properties

    hashtag
    id

    TextElementUpdate


    hashtag
    Properties

    hashtag
    id

    NoteElementUpdate


    hashtag
    Properties

    hashtag
    id

    TextElementRead


    hashtag
    Properties

    hashtag
    id

    PlaceElementUpdate


    hashtag
    Properties

    hashtag
    id

    CreateLayersFromGeoJsonParams


    The parameters for the method.

    hashtag
    Properties

    hashtag

    GetLayerHistogramParams


    The params used to request a histogram of values from a layer, passed to the method.

    hashtag
    Properties

    hashtag

    LayerFeature


    A LayerFeature is a single geographical item in a layer.

    It is intended to be a lightweight object that contains the properties of a feature, but not the geometry. It is returned by methods like and , and as part of the methods in the

    The geometry can be obtained via the method, which returns a object.

    hashtag
    Properties

    MarkerElementRead


    hashtag
    Properties

    hashtag
    id

    PolygonElementCreate


    hashtag
    Properties

    hashtag
    type

    HighlighterElementRead


    hashtag
    Properties

    hashtag
    id

    HighlighterElementUpdate


    hashtag
    Properties

    hashtag
    id

    CircleElementCreate
  • MarkerElementCreate

  • HighlighterElementCreate

  • TextElementCreate

  • NoteElementCreate

  • ImageElementCreate

  • PlaceElementRead

  • PathElementRead

  • PolygonElementRead

  • CircleElementRead

  • MarkerElementRead

  • HighlighterElementRead

  • TextElementRead

  • NoteElementRead

  • ImageElementRead

  • LinkElementRead

  • PlaceElementUpdate

  • PathElementUpdate

  • PolygonElementUpdate

  • CircleElementUpdate

  • MarkerElementUpdate

  • HighlighterElementUpdate

  • TextElementUpdate

  • NoteElementUpdate

  • ImageElementUpdate

  • ElementsController
    PlaceElementCreate
    PathElementCreate
    PolygonElementCreate
    ElementCreate
    ElementUpdate
    ElementGroup
    GetElementGroupsConstraint
    ElementGroupChangeCallbackParams
    GetElementsConstraint
    ElementChangeCallbackParams
    Element
    MultiPolygonGeometry
    GeometryFilter
    LayersController.setLayerBoundary
    MultiPolygonGeometry
    MultiAggregationConfig
    Filters
    GeometryFilter
    AggregationMethod
    hashtag
    id

    id: string | number

    The identifier of the feature, unique within the layer.


    hashtag
    isDeterministicId

    isDeterministicId: boolean

    Whether the id is deterministic.

    hashtag
    Remarks

    If the id is deterministic, it means that the id can be used to reference the feature in the layer and therefore in all the SDK feature-related methods.

    When the id is not deterministic, the feature cannot be referenced on SDK methods like FeltController.getFeature or SelectionController.selectFeature.

    For layers created and processed on Felt servers, the feature IDs are deterministic because Felt ensures every feature is correctly identified in vector tiles. This cannot be guaranteed for layers created using a GeoJSON source on the SDK (see LayersController.createLayersFromGeoJson) where the ID will only be deterministic if GeoJSON features have an id property.


    hashtag
    layerId

    layerId: string

    The identifier of the layer that the feature belongs to.


    hashtag
    geometryType

    geometryType: "Polygon" | "MultiPolygon" | "LineString" | "MultiLineString" | "Point" | "MultiPoint" | string & {}

    The type of geometry of the feature.

    hashtag
    Remarks

    Because LayerFeatures can be read from tiled features, it's possible that this geometryType won't match the geometry.type of the GeoJsonFeature returned by FeltController.getGeoJsonFeature.

    For example, this may return LineString but the full feature is a MultiLineString, or, similarly Polygon here may be a MultiPolygon in the full feature.

    As a result, you should treat this property as being indicative only.


    hashtag
    bbox

    bbox: undefined | [number, number, number, number]

    The bounding box of the feature.

    hashtag
    Remarks

    Because LayerFeatures can be read from tiled features and considering that feature geometry can go through multiple tiles, it's possible that this is not the complete bounding box of the feature.


    hashtag
    properties

    properties: GeoJsonProperties

    The properties of the feature, as a bag of attributes.

    FeltController.getRenderedFeatures
    FeltController.getFeature
    SelectionController
    FeltController.getGeoJsonFeature
    GeoJsonFeature

    GetLayerGroupsConstraint


    The constraints to apply when getting layer groups.

    hashtag
    Properties

    hashtag
    ids?

    optional ids: string[]

    The ids of the layer groups to get.

    LngLatTuple
    LngLatTuple
    LngLatTuple
    LngLatTuple
    LngLatTuple
    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    rotation

    rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale

    scale: number

    The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.

    hashtag
    Default


    hashtag
    zoom

    zoom: number

    The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.

    When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    text

    text: string

    The text in the element.


    hashtag
    align

    align: "center" | "left" | "right"

    The alignment of the text, either left, center or right.

    hashtag
    Default


    hashtag
    style

    style: "light" | "italic" | "regular" | "caps"

    The style of the text, either italic, light, regular or caps.

    hashtag
    Default


    hashtag
    name

    name: string

    The text shown in the element, which is identical to the text property.

    hashtag
    Remarks

    This is added for consistency with other elements that have a name property.


    hashtag
    type

    type: "Note"


    hashtag
    widthScale

    widthScale: number


    hashtag
    position

    position: LngLatTuple

    The geographical position of the center of the note element.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Text"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

    The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

    The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.

    When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    text?

    optional text: string

    The text in the element.


    hashtag
    align?

    optional align: "center" | "left" | "right"

    The alignment of the text, either left, center or right.

    hashtag
    Default


    hashtag
    style?

    optional style: "light" | "italic" | "regular" | "caps"

    The style of the text, either italic, light, regular or caps.

    hashtag
    Default


    hashtag
    position?

    optional position: LngLatTuple

    The geographical position of the center of the text element.

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Note"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

    The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

    The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.

    When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    text?

    optional text: string

    The text in the element.


    hashtag
    align?

    optional align: "center" | "left" | "right"

    The alignment of the text, either left, center or right.

    hashtag
    Default


    hashtag
    style?

    optional style: "light" | "italic" | "regular" | "caps"

    The style of the text, either italic, light, regular or caps.

    hashtag
    Default


    hashtag
    widthScale?

    optional widthScale: number


    hashtag
    position?

    optional position: LngLatTuple

    The geographical position of the center of the note element.

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    rotation

    rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale

    scale: number

    The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.

    hashtag
    Default


    hashtag
    zoom

    zoom: number

    The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.

    When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    text

    text: string

    The text in the element.


    hashtag
    align

    align: "center" | "left" | "right"

    The alignment of the text, either left, center or right.

    hashtag
    Default


    hashtag
    style

    style: "light" | "italic" | "regular" | "caps"

    The style of the text, either italic, light, regular or caps.

    hashtag
    Default


    hashtag
    name

    name: string

    The text shown in the element, which is identical to the text property.

    hashtag
    Remarks

    This is added for consistency with other elements that have a name property.


    hashtag
    type

    type: "Text"


    hashtag
    position

    position: LngLatTuple

    The geographical position of the center of the text element.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Place"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    symbol?

    optional symbol: string

    The symbol that is rendered for the Place.

    This can be an emoji by using colon-enclosed characters (e.g. ":smiley:") or one of the symbols available in Felt's symbol library.

    You can see the available symbols in the Felt UI when editing a Place by hovering a symbol and converting the tooltip to kebab-case. For example, the "Oil barrel" symbol is oil-barrel.


    hashtag
    frame?

    optional frame: null | "frame-circle" | "frame-square"

    The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.


    hashtag
    hideLabel?

    optional hideLabel: boolean

    Whether the element's label is hidden on the map. This allows you to add a name to the element and can show in popups, but not have it visible on the map.

    This will also hide the faint placeholder label that is shown when an editable Place is selected.

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: LngLatTuple

    name

    name: string

    The name of the layer to create.


    hashtag
    source

    source: GeoJsonUrlVectorSource | GeoJsonDataVectorSource | GeoJsonFileVectorSource

    The source of the GeoJSON data.


    hashtag
    bounds?

    optional bounds: [number, number, number, number]

    Sets the bounds of the layer.


    hashtag
    caption?

    optional caption: string

    Sets the caption of the layer.


    hashtag
    description?

    optional description: string

    Sets the description of the layer.


    hashtag
    geometryStyles?

    optional geometryStyles: { Point: object; Line: object; Polygon: object; }

    The styles to apply to each geometry on the layer.

    Each style should be a valid FSL style, as described in Layer.style.

    These are optional, and if missing will use a default style determined by Felt, which you can consider to be undefined behaviour.

    Name
    Type

    Point?

    object

    Line?

    object

    Polygon?

    object

    hashtag
    Example

    LayersController.createLayersFromGeoJson
    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    type

    type: "Marker"


    hashtag
    opacity

    opacity: number

    The opacity of the marker, between 0 and 1.

    hashtag
    Default


    hashtag
    size

    size: number

    The size of the marker, used in conjunction with the zoom to determine the actual size of the marker.

    hashtag
    Default


    hashtag
    zoom

    zoom: number

    The zoom level at which the marker was created. This is combined with the size to determine the actual size of the marker.

    When creating a marker, if you don't supply this value it defaults to the current zoom of the map when you call createElement.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    type: "Polygon"

    hashtag
    coordinates

    coordinates: LngLatTuple[][]


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

    optional strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

    The opacity of the polygon's fill, between 0 and 1.

    hashtag
    Default


    hashtag
    areaMarker?

    optional areaMarker: boolean

    Whether to show an area marker on the polygon.

    hashtag
    Default

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    type

    type: "Highlighter"


    hashtag
    renderHoles

    renderHoles: boolean

    Whether to render the holes of the highlighted area.

    hashtag
    Default


    hashtag
    opacity

    opacity: number

    The opacity of the highlighter, between 0 and 1.

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Highlighter"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    renderHoles?

    optional renderHoles: boolean

    Whether to render the holes of the highlighted area.

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the highlighter, between 0 and 1.

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: LngLatTuple[][][]

    A multipolygon describing the area that is highlighted.

    If renderHoles is set to false, only the outer ring of each polygon will be rendered, filling in the area inside the highlighted region.

    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    2
    "solid"
    false
    null
    false
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    10
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false
    0.5
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    10
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    0
    1
    "center"
    "regular"
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    0
    1
    "center"
    "regular"
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false
    const layer = await layersController.createLayersFromGeoJson({
      name: "My Layer",
      geometryStyles: {
        Point: {
          paint: { color: "red", size: 8 },
        },
        Line: {
          paint: { color: "blue", size: 4 },
          config: { labelAttribute: ["name"] },
          label: { minZoom: 0 },
        },
        Polygon: {
          paint: { color: "green", strokeColor: "darkgreen" },
        },
      },
    });
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    10
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    0.25
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    false
    0.5
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false
    0.5
    hashtag
    Events

    hashtag
    onPointerClick()

    onPointerClick(params: { handler: (event: MapInteractionEvent) => 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.

    hashtag
    Parameters

    Parameter
    Type

    params

    { handler: (event: ) => void; }

    params.handler

    (event: ) => void

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onPointerMove()

    onPointerMove(params: { handler: (event: MapInteractionEvent) => 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.

    hashtag
    Parameters

    Parameter
    Type
    Description

    params

    { handler: (event: ) => void; }

    Params for the listener

    params.handler

    (event: ) => void

    The handler function

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example

    FeltController
    layerId

    layerId: string


    hashtag
    attribute

    attribute: string


    hashtag
    steps

    steps: number[] | { type: "equal-intervals"; count: number; } | { type: "time-interval"; interval: "hour" | "day" | "week" | "month" | "year"; }


    hashtag
    values?

    optional values: { boundary: [number, number][] | [number, number, number, number] | { type: "Polygon"; coordinates: [number, number][][]; } | { type: "MultiPolygon"; coordinates: [number, number][][][]; }; filters: null | boolean | [null | string, "in" | "ni", null | (null | string | number | boolean)[]] | [null | string, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", null | string | number | boolean] | ; aggregation: { method: "min" | "max" | "avg" | "sum" | "median"; attribute: string; }; }

    Configuration for filtering and aggregating values while preserving the full set of bin ranges in the results.

    This is particularly useful when you want to compare different subsets of data while maintaining consistent ranges. For example:

    • Use the same height ranges for comparing old vs new buildings

    Unlike top-level filters which affect both what ranges appear AND their values, filters in this configuration only affect the values while keeping all possible ranges in the results.

    Name
    Type
    Default value
    Description

    boundary?

    [number, number][] | [number, number, number, number] | { type: "Polygon"; coordinates: [number, number][][]; } | { type: "MultiPolygon"

    -

    -

    filters?

    null | boolean | [null | string, "in" | "ni", null | (null | string | number | boolean)[]] | [null | string

    -

    -

    aggregation?

    { method: "min" | "max" | "avg" | "sum" | "median"; attribute: string; }

    -


    hashtag
    filters?

    optional filters: Filters

    Attribute filters for the features to include when calculating the histogram bins.


    hashtag
    boundary?

    optional boundary: GeometryFilter

    The spatial boundary for the features to include when calculating the histogram bins.

    LayersController.getHistogramData

    CircleElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    imageUrl

    imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity

    strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth

    strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle

    strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    type

    type: "Circle"


    hashtag
    radius

    radius: number

    The radius of the circle in meters.


    hashtag
    radiusMarker

    radiusMarker: boolean

    Whether to show a marker on the circle that indicates the radius

    hashtag
    Default


    hashtag
    radiusDisplayAngle

    radiusDisplayAngle: number

    The angle at which the control point for setting the radius is displayed, in degrees. When the radiusMarker is true, there is a dotted line rendered from the center of the circle to the control point, and the marker is shown at the midpoint of this line.

    hashtag
    Default


    hashtag
    radiusDisplayUnit

    radiusDisplayUnit: null | "meter" | "kilometer" | "foot" | "mile"

    The unit of the radius used when the radiusMarker is true.

    A value of null means that the unit matches the user's locale.

    hashtag
    Default


    hashtag
    fillOpacity

    fillOpacity: number

    The opacity of the circle's fill.

    hashtag
    Default


    hashtag
    center

    center:

    The center of the circle.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    CircleElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Circle"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

    optional strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    radius?

    optional radius: number

    The radius of the circle in meters.


    hashtag
    radiusMarker?

    optional radiusMarker: boolean

    Whether to show a marker on the circle that indicates the radius

    hashtag
    Default


    hashtag
    radiusDisplayAngle?

    optional radiusDisplayAngle: number

    The angle at which the control point for setting the radius is displayed, in degrees. When the radiusMarker is true, there is a dotted line rendered from the center of the circle to the control point, and the marker is shown at the midpoint of this line.

    hashtag
    Default


    hashtag
    radiusDisplayUnit?

    optional radiusDisplayUnit: null | "meter" | "kilometer" | "foot" | "mile"

    The unit of the radius used when the radiusMarker is true.

    A value of null means that the unit matches the user's locale.

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

    The opacity of the circle's fill.

    hashtag
    Default


    hashtag
    center?

    optional center:

    The center of the circle.

    Filters


    Filters: FilterTernary | FilterExpression | null | boolean

    Filters can be used to change which features in a layer are rendered. Filters can be applied to a layer by the setLayerFilters method on the Felt controller.

    Filters use a tree structure for combining expressions with logical operators, called a FilterTernary. When combining three or more conditions, you must use proper nesting rather than a flat list.

    See the examples below for the correct structure to use when building complex filters.

    hashtag
    Remarks

    The possible operators are:

    • lt: Less than

    • gt: Greater than

    • le: Less than or equal to

    The allowed boolean operators are:

    • and: Logical AND

    • or: Logical OR

    hashtag
    Example

    CircleElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Circle"


    hashtag
    radius

    radius: number

    The radius of the circle in meters.


    hashtag
    center

    center:

    The center of the circle.


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

    optional strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    radiusMarker?

    optional radiusMarker: boolean

    Whether to show a marker on the circle that indicates the radius

    hashtag
    Default


    hashtag
    radiusDisplayAngle?

    optional radiusDisplayAngle: number

    The angle at which the control point for setting the radius is displayed, in degrees. When the radiusMarker is true, there is a dotted line rendered from the center of the circle to the control point, and the marker is shown at the midpoint of this line.

    hashtag
    Default


    hashtag
    radiusDisplayUnit?

    optional radiusDisplayUnit: null | "meter" | "kilometer" | "foot" | "mile"

    The unit of the radius used when the radiusMarker is true.

    A value of null means that the unit matches the user's locale.

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

    The opacity of the circle's fill.

    hashtag
    Default

    PolygonElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Polygon"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

    optional strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

    The opacity of the polygon's fill, between 0 and 1.

    hashtag
    Default


    hashtag
    areaMarker?

    optional areaMarker: boolean

    Whether to show an area marker on the polygon.

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: [][]

    PathElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Path"


    hashtag
    coordinates

    coordinates: [][]


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

    optional strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    distanceMarker?

    optional distanceMarker: boolean

    Whether a distance marker is shown at the midpoint of the path.

    hashtag
    Default


    hashtag
    routingMode?

    optional routingMode: null | "driving" | "cycling" | "walking" | "flying"

    Whether this represents a route, and if so, what mode of transport is used.

    If this is null, the path is not considered to be a route, so while it can have a distanceMarker, it will does not have a start or end cap.

    hashtag
    Default


    hashtag
    endCaps?

    optional endCaps: boolean

    Whether or not to show Start and End caps on the path. This is only available if the routingMode is set.

    hashtag
    Default

    PlaceElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    imageUrl

    imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    type

    type: "Place"


    hashtag
    symbol

    symbol: string

    The symbol that is rendered for the Place.

    This can be an emoji by using colon-enclosed characters (e.g. ":smiley:") or one of the symbols available in Felt's symbol library.

    You can see the available symbols in the Felt UI when editing a Place by hovering a symbol and converting the tooltip to kebab-case. For example, the "Oil barrel" symbol is oil-barrel.


    hashtag
    frame

    frame: null | "frame-circle" | "frame-square"

    The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.


    hashtag
    hideLabel

    hideLabel: boolean

    Whether the element's label is hidden on the map. This allows you to add a name to the element and can show in popups, but not have it visible on the map.

    This will also hide the faint placeholder label that is shown when an editable Place is selected.

    hashtag
    Default


    hashtag
    coordinates

    coordinates:


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    DataOnlyLayer


    A data-only layer doesn't have any geometry, but can be used to join with other layers

    hashtag
    Properties

    hashtag
    id

    id: string

    A string identifying the layer


    hashtag
    groupId

    groupId: null | string

    The ID of the layer group that the layer belongs to.

    Layers that appear at the root level in Felt will not have a group ID.


    hashtag
    name

    name: string

    The name of the layer can be displayed in the Legend, depending on how the layer's legend is configured in its style.


    hashtag
    caption

    caption: null | string

    The layer's caption is shown in the legend.


    hashtag
    description

    description: null | string

    The layer description forms part of the layer's metadata. This is visible to users via the layer info button in the legend.


    hashtag
    visible

    visible: boolean

    Whether the layer is visible or not.


    hashtag
    shownInLegend

    shownInLegend: boolean

    Whether the layer is shown in the legend or not.


    hashtag
    legendDisplay

    legendDisplay: "default" | "nameOnly"

    The display mode for the layer's legend.

    See for more details.


    hashtag
    style

    style: object

    The FSL style for the layer.

    See the for details on how to read and write styles.

    As the types of the styles are very complex, we return object here and advise that you program defensively while reading the styles.


    hashtag
    status

    status: "processing" | "completed" | "failed" | "incomplete"

    The current processing status of the layer.


    hashtag
    geometryType

    geometryType: null

    Indicates that this layer has no geometry.


    hashtag
    bounds

    bounds: null

    This is always null for data-only layers.

    PathElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Path"


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color?

    optional color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

    optional strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    distanceMarker?

    optional distanceMarker: boolean

    Whether a distance marker is shown at the midpoint of the path.

    hashtag
    Default


    hashtag
    routingMode?

    optional routingMode: null | "driving" | "cycling" | "walking" | "flying"

    Whether this represents a route, and if so, what mode of transport is used.

    If this is null, the path is not considered to be a route, so while it can have a distanceMarker, it will does not have a start or end cap.

    hashtag
    Default


    hashtag
    endCaps?

    optional endCaps: boolean

    Whether or not to show Start and End caps on the path. This is only available if the routingMode is set.

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: [][]

    PolygonElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    color

    color: string

    The color of the element in some CSS-like format.

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description

    description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes

    attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    imageUrl

    imageUrl: null | string

    The URL of an image that has been added to the element.


    hashtag
    strokeOpacity

    strokeOpacity: number

    A value between 0 and 1 that describes the opacity of the element's stroke.

    hashtag
    Default


    hashtag
    strokeWidth

    strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle

    strokeStyle: "solid" | "dashed" | "dotted"

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    type

    type: "Polygon"


    hashtag
    fillOpacity

    fillOpacity: number

    The opacity of the polygon's fill, between 0 and 1.

    hashtag
    Default


    hashtag
    areaMarker

    areaMarker: boolean

    Whether to show an area marker on the polygon.

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default

    LayerCommon


    The common properties for all layers.

    hashtag
    Properties

    hashtag
    id

    id: string

    A string identifying the layer


    hashtag
    groupId

    groupId: null | string

    The ID of the layer group that the layer belongs to.

    Layers that appear at the root level in Felt will not have a group ID.


    hashtag
    name

    name: string

    The name of the layer can be displayed in the Legend, depending on how the layer's legend is configured in its style.


    hashtag
    caption

    caption: null | string

    The layer's caption is shown in the legend.


    hashtag
    description

    description: null | string

    The layer description forms part of the layer's metadata. This is visible to users via the layer info button in the legend.


    hashtag
    visible

    visible: boolean

    Whether the layer is visible or not.


    hashtag
    shownInLegend

    shownInLegend: boolean

    Whether the layer is shown in the legend or not.


    hashtag
    legendDisplay

    legendDisplay: "default" | "nameOnly"

    The display mode for the layer's legend.

    See for more details.


    hashtag
    style

    style: object

    The FSL style for the layer.

    See the for details on how to read and write styles.

    As the types of the styles are very complex, we return object here and advise that you program defensively while reading the styles.


    hashtag
    status

    status: "processing" | "completed" | "failed" | "incomplete"

    The current processing status of the layer.


    hashtag
    bounds

    bounds: null | [number, number, number, number]

    The bounding box of the layer in [west, south, east, north] order

    There are cases where the bounds are not available, such as for layers added to the map from URL sources, as these are not (depending on their type) processed and analyzed by Felt.

    LayerSchemaNumericAttribute


    The schema for a numeric attribute on a layer.

    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for this attribute.

    This can be used to fetch statistics, categories, histograms etc. for this attribute via the , , and methods.


    hashtag
    displayName

    displayName: string

    The human-readable name of this attribute.


    hashtag
    detailedType

    detailedType: string

    The specific data type of this attribute, providing more detail than the basic type.

    For instance, a numeric attribute might be "INTEGER", "FLOAT, etc.


    hashtag
    distinctCount

    distinctCount: number

    The number of distinct values present for this attribute across all features.


    hashtag
    type

    type: "numeric"

    Indicates this is a numeric attribute.


    hashtag
    sampleValues

    sampleValues: { value: number; count: number; }[]

    A small sample of values for this attribute and their frequency.

    Name
    Type

    hashtag
    min

    min: number

    The minimum value present for this attribute across all features.


    hashtag
    max

    max: number

    The maximum value present for this attribute across all features.

    ImageElementCreate


    hashtag
    Properties

    hashtag
    type

    MapInteractionEvent


    The event object passed to the interaction listeners.

    hashtag
    Properties

    hashtag

    LayerSchemaCommonAttribute


    The common schema for all attributes.

    hashtag
    Properties

    hashtag

    LayerSchemaAttribute


    LayerSchemaAttribute: | | | |

    A single attribute from the layer schema.

    hashtag
    Remarks

    Each feature in a layer has a set of attributes, and these types describe the structure of a single attribute, including things like id, display name, type, and sample values.

    const unsubscribe = felt.onPointerClick({
      handler: (event) => console.log(event.center, event.features),
    });
    
    // later on...
    unsubscribe();
    // 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();
    coordinate

    coordinate: LatLng

    The cursor position in world coordinates.


    hashtag
    point

    point: { x: number; y: number; }

    The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.

    Name
    Type

    x

    number

    y

    number


    hashtag
    features

    features: LayerFeature[]

    The vector features that are under the cursor.


    hashtag
    rasterValues

    rasterValues: RasterValue[]

    The raster pixel values that are under the cursor.

    id

    id: string

    The unique identifier for this attribute.

    This can be used to fetch statistics, categories, histograms etc. for this attribute via the LayersController.getCategoryData, LayersController.getHistogramData, and LayersController.getAggregates methods.


    hashtag
    displayName

    displayName: string

    The human-readable name of this attribute.


    hashtag
    detailedType

    detailedType: string

    The specific data type of this attribute, providing more detail than the basic type.

    For instance, a numeric attribute might be "INTEGER", "FLOAT, etc.


    hashtag
    distinctCount

    distinctCount: number

    The number of distinct values present for this attribute across all features.

    LegendDisplay
    FSL documentationarrow-up-right
    LegendDisplay
    FSL documentationarrow-up-right
    FeltBoundary

    value

    number

    count

    number

    LayersController.getCategoryData
    LayersController.getHistogramData
    LayersController.getAggregates
    MapInteractionEvent
    MapInteractionEvent
    MapInteractionEvent
    MapInteractionEvent
    LayerSchemaNumericAttribute
    LayerSchemaTextAttribute
    LayerSchemaBooleanAttribute
    LayerSchemaDateAttribute
    LayerSchemaDateTimeAttribute
    ;
    coordinates
    : [
    number
    ,
    number
    ][][][]; }
    ,
    "lt"
    |
    "gt"
    |
    "le"
    |
    "ge"
    |
    "eq"
    |
    "ne"
    |
    "cn"
    |
    "nc"
    |
    "is"
    |
    "isnt"
    ,
    null
    |
    string
    |
    number
    |
    boolean
    ] |

    -

    aggregation.method

    "min" | "max" | "avg" | "sum" | "median"

    AggregateMethodSchema

    The operation to use on the values from the features in the layer

    aggregation.attribute

    string

    -

    The attribute to use for the aggregation. This must be a numeric attribute.

    FilterTernary
    FilterTernary
    LngLatTuple
    LngLatTuple

    ge: Greater than or equal to

  • eq: Equal to

  • ne: Not equal to

  • cn: Contains

  • nc: Does not contain

  • is: Is

  • isnt: Is not

  • in: In

  • ni: Not in

  • LngLatTuple
    LngLatTuple
    LngLatTuple
    LngLatTuple
    LngLatTuple
    type: "Image"

    hashtag
    coordinates

    coordinates: [number, number][][] = MultiLineStringGeometrySchema.shape.coordinates


    hashtag
    imageUrl

    imageUrl: string

    The URL of the image that is rendered in this element


    hashtag
    groupId?

    optional groupId: null | string

    The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.


    hashtag
    name?

    optional name: null | string

    The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.

    For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.


    hashtag
    description?

    optional description: null | string

    Text describing the element, which is shown in an element's popup when it is selected.

    Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

    A set of key-value pairs that can be used to store arbitrary data about the element.

    This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

    The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.

    If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.

    Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the image, between 0 and 1.

    hashtag
    Default

    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    2
    "solid"
    false
    90
    null
    0.25
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    90
    null
    0.25
    // 1. Simple filter: single condition
    felt.setLayerFilters({
      layerId: "layer-1",
      filters: ["AREA", "gt", 30_000],
    });
    
    // 2. Basic compound filter: two conditions with AND
    felt.setLayerFilters({
      layerId: "layer-1",
      filters: [
        ["AREA", "gt", 30_000],  // First condition
        "and",                   // Logic operator
        ["COLOR", "eq", "red"]   // Second condition
      ]
    });
    
    // 3. Complex filter: three or more conditions require nesting
    // ⚠️ IMPORTANT: Filters use a tree structure, not a flat list
    felt.setLayerFilters({
      layerId: "layer-1",
      filters: [
        ["AREA", "gt", 30_000],                // First condition
        "and",                                 // First logic operator
        [                                      // Nested group starts
          ["COLOR", "eq", "red"],              //   Second condition
          "and",                               //   Second logic operator
          ["TYPE", "eq", "residential"]        //   Third condition
        ]                                      // Nested group ends
      ]
    });
    
    // 4. Even more complex: four conditions with proper nesting
    // Visual structure:
    //          AND
    //         /   \
    //    condition  AND
    //              /   \
    //        condition  AND
    //                  /   \
    //            condition  condition
    felt.setLayerFilters({
      layerId: "layer-1",
      filters: [
        ["AREA", "gt", 30_000],                // First condition
        "and",
        [
          ["COLOR", "eq", "red"],              // Second condition
          "and",
          [
            ["TYPE", "eq", "residential"],     // Third condition
            "and",
            ["YEAR", "gt", 2000]               // Fourth condition
          ]
        ]
      ]
    });
    
    // 5. Mixed operators: combining AND and OR
    // Visual structure:
    //          AND
    //         /   \
    //    condition  OR
    //              /  \
    //        condition condition
    felt.setLayerFilters({
      layerId: "layer-1",
      filters: [
        ["AREA", "gt", 30_000],                // Must have large area
        "and",
        [
          ["COLOR", "eq", "red"],              // Must be either red
          "or",
          ["TYPE", "eq", "residential"]        // OR residential type
        ]
      ]
    });
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    90
    null
    0.25
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    0.25
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    null
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    false
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    null
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    2
    "solid"
    0.25
    false
    "default"
    "default"
    1

    Layers


    Layers in a Felt map hold geospatial data, but also configure how the data is rendered both on the map and in the legend. The data can be vector data such as Points, Lines, or Polygons, or raster data such as satellite images.

    Each Layer can be grouped under a LayerGroup, and has associated LegendItems that represent how the layer is rendered in the legend.

    You can control the visibility of layers, layer groups, and legend items using the `setLayerVisibility`, `setLayerGroupVisibility`, and `setLegendItemVisibility` methods.

    When a Layer is styled to as categorical data or "classed" numeric data, there will be a LegendItem for each category or class. Each LegendItem can be controlled for visibility independently of the Layer, so you can turn on and off each category or class individually.

    hashtag
    Controller

    hashtag
    Features

    hashtag
    Filters

    hashtag
    Layer Groups

    hashtag
    Layer Schema

    hashtag
    Layer sources

    hashtag
    Layers

    hashtag
    Legend Items

    hashtag
    Stats

    BasemapsController


    The basemaps controller allows you to manage the map's basemap layer.

    You can get the current basemap, list available basemaps, change the basemap, and be notified when the basemap changes.

    hashtag
    Extended by

    hashtag
    Methods

    hashtag
    getCurrentBasemap()

    getCurrentBasemap(): Promise<>

    Gets the currently active basemap.

    Use this method to retrieve information about the current basemap, including its type (Felt, color, or custom tile), name, color scheme, and attribution.

    hashtag
    Returns

    Promise<>

    A promise that resolves to the current basemap configuration.

    hashtag
    Example


    hashtag
    getBasemaps()

    getBasemaps(): Promise<[]>

    Gets all basemaps available on the map.

    Use this method to retrieve a list of all available basemaps that can be applied to the map.

    hashtag
    Returns

    Promise<[]>

    A promise that resolves to all basemaps available on the map.

    hashtag
    Example


    hashtag
    chooseBasemap()

    chooseBasemap(id: string): void

    Chooses the basemap to use for the map.

    Use this method to change the current basemap. The basemap ID can be obtained from getBasemaps().

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    void

    A promise that resolves when the basemap has been set.

    hashtag
    Example


    hashtag
    addCustomBasemap()

    addCustomBasemap(args: { basemap: | ; select: boolean; }): Promise<>

    Adds a custom basemap to the map. This can be either a solid color or a basemap from a custom tile URL.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<>

    A promise for the added basemap.

    hashtag
    Example


    hashtag
    removeBasemap()

    removeBasemap(id: string): Promise<void>

    Removes a basemap from the list of available basemaps.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<void>

    A promise that resolves when the basemap has been removed.

    hashtag
    Events

    hashtag
    onBasemapChange()

    onBasemapChange(args: { handler: (basemap: ) => void; }): VoidFunction

    Adds a listener for when the basemap changes.

    Use this to react to basemap changes, such as updating your UI or adjusting other map elements to match the new basemap's color scheme.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example

  • LayersController
    LayerFeature
    RasterValue
    LayerFilters
    LayerBoundaries
    FilterLogicGate
    LayerGroup
    GetLayerGroupsConstraint
    LayerGroupChangeCallbackParams
    LayerSchema
    LayerSchemaCommonAttribute
    LayerSchemaNumericAttribute
    RasterLayerSource
    RasterBand
    GeoJsonUrlVectorSource
    LayerCommon
    RasterLayer
    VectorLayer
    LegendItem
    LegendItemIdentifier
    LegendItemsConstraint
    AggregationConfig
    MultiAggregationConfig
    ValueConfiguration

    id

    string

    args

    { basemap: | ; select: boolean; }

    -

    args.basemap

    |

    The basemap to add.

    args.select?

    boolean

    Whether to select the basemap after adding it.

    id

    string

    args

    { handler: (basemap: ) => void; }

    args.handler

    (basemap: ) => void

    FeltController
    Basemap
    Basemap
    Basemap
    Basemap
    ColorBasemapInput
    CustomTileBasemapInput
    Basemap
    Basemap
    Basemap
    // Get current basemap
    const basemap = await felt.getCurrentBasemap();
    console.log({
      name: basemap.name,
      type: basemap.type,
      uiColorScheme: basemap.uiColorScheme,
    });
    // Get all available basemaps
    const basemaps = await felt.getBasemaps();
    const lightBasemaps = basemaps.filter(b => b.uiColorScheme === "light");
    // Switch to a specific basemap
    const basemaps = await felt.getBasemaps();
    const darkBasemap = basemaps.find(b => b.uiColorScheme === "dark");
    if (darkBasemap) {
      await felt.chooseBasemap(darkBasemap.id);
    }
    // Add a custom basemap and select it
    await felt.addCustomBasemap({
      basemap: {
        type: "xyz_tile",
        tileUrl: "https://example.com/tile.png"
      },
      select: true,
    });
    // Listen for basemap changes
    const unsubscribe = felt.onBasemapChange({
      handler: basemap => {
        console.log(`Switched to ${basemap.name}`);
        updateUIColors(basemap.uiColorScheme);
      },
    });
    
    // later on...
    unsubscribe();
    FilterExpression
    FilterTernary
    Filters
    GeometryFilter
    LayerSchemaTextAttribute
    LayerSchemaBooleanAttribute
    LayerSchemaDateAttribute
    LayerSchemaDateTimeAttribute
    LayerSchemaAttribute
    GeoJsonDataVectorSource
    GeoJsonFileVectorSource
    FeltTiledVectorSource
    UpdateLayerParams
    DataOnlyLayer
    GetLayersConstraint
    LayerChangeCallbackParams
    GetRenderedFeaturesConstraint
    CreateLayersFromGeoJsonParams
    LayerProcessingStatus
    Layer
    LegendItemChangeCallbackParams
    LegendDisplay
    GetLayerCategoriesParams
    GetLayerCategoriesGroup
    GetLayerHistogramParams
    GetLayerHistogramBin
    GetLayerCalculationParams
    CountGridConfig
    AggregatedGridConfig
    GetLayerPrecomputedCalculationParams
    AggregationMethod
    PrecomputedAggregationMethod
    GridType
    GridConfig
    ColorBasemapInput
    CustomTileBasemapInput
    ColorBasemapInput
    CustomTileBasemapInput
    Basemap
    Basemap

    ElementsController


    The Elements controller allows you to get information about the elements on the map, and make changes to their visibility.

    hashtag
    Extended by

    • FeltController

    hashtag
    Methods

    hashtag
    getElement()

    getElement(id: string): Promise<null | >

    Get a single element from the map by its id.

    Use this method when you know the specific ID of an element and want to retrieve its current state. This is more efficient than getting all elements and filtering.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<null | >

    A promise that resolves to the requested element, or null if not found.

    hashtag
    Example


    hashtag
    getElementGeometry()

    getElementGeometry(id: string): Promise<null | >

    Get the geometry of an element in GeoJSON geometry format.

    For most element types, the geometry returned is based on the coordinates property of the element, with some differences:

    • For Circle elements, the geometry is a Polygon drawn from the center and radius properties.

    • Path elements become MultiLineString geometries.

    • Marker elements return a MultiLineString of the path traced by the user as they drew the marker. Note that this is not the polygon formed by filled-in "pen" stroke, which doesn't exactly follow the path traced by the user as it is smoothed and interpolated to create a continuous line.

    Use this method when you need the geometric representation of an element for spatial analysis or visualization purposes.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<null | >

    A promise that resolves to the element's geometry in GeoJSON format, or null if the element has no geometry.

    hashtag
    Example


    hashtag
    getElements()

    getElements(constraint?: ): Promise<(null | )[]>

    Gets elements from the map, according to the constraints supplied. If no constraints are supplied, all elements will be returned.

    Use this method to retrieve multiple elements, optionally filtered by constraints. This is useful for bulk operations or when you need to analyze all elements on the map.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<(null | )[]>

    A promise that resolves to an array of elements, ordered by the order specified in Felt.

    hashtag
    Remarks

    The elements in the map, ordered by the order specified in Felt. This is not necessarily the order that they are drawn in, as Felt draws points above lines and lines above polygons, for instance.

    hashtag
    Example


    hashtag
    getElementGroup()

    getElementGroup(id: string): Promise<null | >

    Get an element group from the map by its id.

    Element groups allow you to organize related elements together and control their visibility as a unit.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<null | >

    A promise that resolves to the requested element group, or null if not found.

    hashtag
    Example


    hashtag
    getElementGroups()

    getElementGroups(constraint?: ): Promise<(null | )[]>

    Gets element groups from the map, according to the filters supplied. If no constraints are supplied, all element groups will be returned in rendering order.

    Use this method to retrieve multiple element groups, optionally filtered by constraints. This is useful for bulk operations on element groups.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<(null | )[]>

    A promise that resolves to an array of element groups in rendering order.

    hashtag
    Example


    hashtag
    setElementGroupVisibility()

    setElementGroupVisibility(visibility: ): Promise<void>

    Hide or show element groups with the given ids.

    Use this method to control the visibility of multiple element groups at once. This is more efficient than hiding/showing individual elements.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<void>

    A promise that resolves when the visibility changes are applied.

    hashtag
    Example


    hashtag
    createElement()

    createElement(element: ): Promise<>

    Create a new element on the map.

    Use this method to programmatically create elements on the map. Elements created via the SDK are only available to the current session and are not persisted.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<>

    A promise that resolves to the created element.

    hashtag
    Example


    hashtag
    updateElement()

    updateElement(element: ): Promise<>

    Update an element on the map. The element type must be specified.

    Use this method to modify existing elements. You can update properties like coordinates, styling, and metadata.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<>

    A promise that resolves to the updated element.

    hashtag
    Example


    hashtag
    deleteElement()

    deleteElement(id: string): Promise<void>

    Delete an element from the map.

    Use this method to remove elements from the map. This operation cannot be undone.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<void>

    A promise that resolves when the element is deleted.

    hashtag
    Example

    hashtag
    Events

    hashtag
    onElementCreate()

    onElementCreate(args: { handler: (change: ) => void; }): VoidFunction

    Adds a listener for when an element is created.

    This will fire when elements are created programmatically, or when the user starts creating an element with a drawing tool.

    When the user creates an element with a drawing tool, it can begin in an invalid state, such as if you've just placed a single point in a polygon.

    You can use the isBeingCreated property to determine if the element is still being created by a drawing tool.

    If you want to know when the element is finished being created, you can use the listener.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementCreateEnd()

    onElementCreateEnd(args: { handler: (params: { element: ; }) => void; }): VoidFunction

    Listens for when a new element is finished being created by a drawing tool.

    This differs from the listener, which fires whenever an element is first created. This fires when the user finishes creating an element which could be after a series of interactions.

    For example, when creating a polygon, the user places a series of points then finishes by pressing Enter or Escape. Or when creating a Place element, they add the marker, type a label, then finally deselect the element.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementChange()

    onElementChange(args: { options: { id: string; }; handler: (change: ) => void; }): VoidFunction

    Adds a listener for when an element changes.

    This will fire when an element is being edited, either on the map by the user or programmatically.

    Like the listener, this will fire when an element is still being created by a drawing tool.

    You can check the property to determine if the element is still being created by a drawing tool.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementDelete()

    onElementDelete(args: { options: { id: string; }; handler: () => void; }): VoidFunction

    Adds a listener for when an element is deleted.

    Use this to react to element deletions, such as cleaning up related data or updating your application state.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementGroupChange()

    onElementGroupChange(args: { options: { id: string; }; handler: (change: ) => void; }): VoidFunction

    Adds a listener for when an element group changes.

    Use this to react to changes in element groups, such as when elements are added to or removed from groups.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example

  • Text, Note and Image elements do not return geometry, so will return null.

  • id

    string

    The id of the element you want to get.

    id

    string

    The id of the element you want to get the geometry of.

    constraint?

    Optional constraints to apply to the elements returned from the map.

    id

    string

    The id of the element group you want to get.

    constraint?

    Optional constraints to apply to the element groups returned from the map.

    visibility

    The visibility configuration for element groups.

    element

    The element configuration to create.

    element

    The element update configuration.

    id

    string

    The id of the element to delete.

    args

    { handler: (change: ) => void; }

    -

    args.handler

    (change: ) => void

    The handler that is called when an element is created. This will fire when elements are created programmatically, or when the user starts creating an element with a drawing tool. When the user creates an element with a drawing tool, it can begin in an invalid state, such as if you've just placed a single point in a polygon. You can use the isBeingCreated property to determine if the element is still being created by a drawing tool. If you want to know when the element is finished being created, you can use the listener.

    args

    { handler: (params: { element: ; }) => void; }

    -

    args.handler

    (params: { element: ; }) => void

    The handler to call whenever this event fires.

    args

    { options: { id: string; }; handler: (change: ) => void; }

    -

    args.options

    { id: string; }

    -

    args.options.id

    string

    The id of the element to listen for changes to.

    args.handler

    (change: ) => void

    The handler that is called when the element changes.

    args

    { options: { id: string; }; handler: () => void; }

    -

    args.options

    { id: string; }

    -

    args.options.id

    string

    The id of the element to listen for deletions of.

    args.handler

    () => void

    The handler that is called when the element is deleted.

    args

    { options: { id: string; }; handler: (change: ) => void; }

    args.options

    { id: string; }

    args.options.id

    string

    args.handler

    (change: ) => void

    Element
    Element
    GeoJsonGeometry
    GeoJsonGeometry
    GetElementsConstraint
    Element
    Element
    ElementGroup
    ElementGroup
    GetElementGroupsConstraint
    ElementGroup
    ElementGroup
    SetVisibilityRequest
    ElementCreate
    Element
    Element
    ElementUpdate
    Element
    Element
    ElementChangeCallbackParams
    `onElementCreateEnd`
    Element
    `onElementCreate`
    ElementChangeCallbackParams
    `onElementCreate`
    `isBeingCreated`
    ElementGroupChangeCallbackParams
    const element = await felt.getElement("element-1");
    const geometry = await felt.getElementGeometry("element-1");
    console.log(geometry?.type, geometry?.coordinates);
    const elements = await felt.getElements();
    const elementGroup = await felt.getElementGroup("element-group-1");
    const elementGroups = await felt.getElementGroups({ ids: ["element-group-1", "element-group-2"] });
    felt.setElementGroupVisibility({ show: ["element-group-1", "element-group-2"], hide: ["element-group-3"] });
    const element = await felt.createElement({ type: "Place", coordinates: [10, 10] });
    // Update a place element's coordinates
    await felt.updateElement({
      id: "element-1",
      type: "Place",
      coordinates: [10, 20]
    });
    
    // Update a polygon's style
    await felt.updateElement({
      id: "element-2",
      type: "Polygon",
      color: "#ABC123",
      fillOpacity: 0.5
    });
    await felt.deleteElement("element-1");
    const unsubscribe = felt.onElementCreate({
      handler: ({isBeingCreated, element}) => console.log(element.id),
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onElementCreateEnd({
      handler: (params) => console.log(params),
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onElementChange({
      options: { id: "element-1" },
      handler: ({element}) => console.log(element.id),
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onElementDelete({
      options: { id: "element-1" },
      handler: () => console.log("element-1 deleted"),
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onElementGroupChange({
      options: { id: "element-group-1" },
      handler: elementGroup => console.log(elementGroup.id),
    });
    
    // later on...
    unsubscribe();
    GetElementsConstraint
    GetElementGroupsConstraint
    SetVisibilityRequest
    ElementCreate
    ElementUpdate
    ElementChangeCallbackParams
    ElementChangeCallbackParams
    `onElementCreateEnd`
    Element
    Element
    ElementChangeCallbackParams
    ElementChangeCallbackParams
    ElementGroupChangeCallbackParams
    ElementGroupChangeCallbackParams

    LayersController


    The Layers controller allows you to get information about the layers on the map, and make changes to their visibility.

    Layers can be organised into groups, and their groups can also have their visibility toggled.

    hashtag
    Extended by

    hashtag
    Methods

    hashtag
    getLayer()

    getLayer(id: string): Promise<null | >

    Get a single layer from the map by its id.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<null | >

    The requested layer.

    hashtag
    Example


    hashtag
    getLayers()

    getLayers(constraint?: ): Promise<(null | )[]>

    Gets layers from the map, according to the constraints supplied. If no constraints are supplied, all layers will be returned.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<(null | )[]>

    All layers on the map.

    hashtag
    Remarks

    The layers in the map, ordered by the order specified in Felt. This is not necessarily the order that they are drawn in, as Felt draws points above lines and lines above polygons, for instance.

    hashtag
    Example


    hashtag
    setLayerVisibility()

    setLayerVisibility(visibility: ): Promise<void>

    Hide or show layers with the given ids.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    setLayerStyle()

    setLayerStyle(params: { id: string; style: object; }): Promise<void>

    Set the style for a layer using FSL, the Felt Style Language.

    Changes are only for this session, and not persisted. This is useful to make temporary changes to a layer's style, such as to highlight a particular layer or feature.

    See the for details on how to read and write styles.

    If the style you set is invalid, you will receive an error explaining the problem in the rejected promise value.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    setLayerLegendVisibility()

    setLayerLegendVisibility(params: ): Promise<void>

    Hide or show layers with the given ids from the legend.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    createLayersFromGeoJson()

    createLayersFromGeoJson(params: ): Promise<null | { layerGroup: ; layers: []; }>

    Adds layers to the map from file or URL sources.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<null | { layerGroup: ; layers: []; }>

    The layer groups that were created.

    hashtag
    Remarks

    This allows you to add temporary layers to the map that don't depend on any processing by Felt. This is useful for viewing data from external sources or remote files.

    hashtag
    Example


    hashtag
    updateLayer()

    updateLayer(params: ): Promise<>

    Update a layer by passing a subset of the layer's properties.

    Note that not all properties can be updated, so check the type to see which properties can be updated.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<>

    hashtag
    Example


    hashtag
    deleteLayer()

    deleteLayer(id: string): Promise<void>

    Delete a layer from the map by its id.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<void>

    hashtag
    Remarks

    This only works for layers created via the SDK createLayersFromGeoJson method, not layers added via the Felt UI.

    hashtag
    Example


    hashtag
    duplicateLayer()

    duplicateLayer(id: string): Promise<>

    Duplicate a layer from the map by its id.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<>

    The duplicated layer.

    hashtag
    Remarks

    This will create an ephemeral copy of the layer, just for the duration of the session. The duplicated layer will not be persisted to the map.

    hashtag
    Example


    hashtag
    getLayerGroup()

    getLayerGroup(id: string): Promise<null | >

    Get a layer group from the map by its id.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<null | >

    The requested layer group.

    hashtag
    Example


    hashtag
    getLayerGroups()

    getLayerGroups(constraint?: ): Promise<(null | )[]>

    Gets layer groups from the map, according to the constraints supplied. If no constraints are supplied, all layer groups will be returned in rendering order.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<(null | )[]>

    The requested layer groups.

    hashtag
    Example


    hashtag
    setLayerGroupVisibility()

    setLayerGroupVisibility(visibility: ): Promise<void>

    Hide or show layer groups with the given ids.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    setLayerGroupLegendVisibility()

    setLayerGroupLegendVisibility(params: ): Promise<void>

    Hide or show layer groups with the given ids from the legend.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    getLegendItem()

    getLegendItem(id: ): Promise<null | >

    Allows you to get the state of a single legend item.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<null | >

    hashtag
    Example


    hashtag
    getLegendItems()

    getLegendItems(constraint?: ): Promise<(null | )[]>

    Allows you to obtain the state of several legend items, by passing in constraints describing which legend items you want.

    If you do not pass any constraints, you will receive all legend items.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<(null | )[]>

    hashtag
    Example


    hashtag
    setLegendItemVisibility()

    setLegendItemVisibility(visibility: { show: []; hide: []; }): Promise<void>

    Hide or show legend items with the given identifiers.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    getLayerFilters()

    getLayerFilters(layerId: string): Promise<null | >

    Get the filters for a layer.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<null | >

    hashtag
    Remarks

    The return type gives you the filters split up into the various sources that make up the overall filters for a layer.

    hashtag
    Example


    hashtag
    setLayerFilters()

    setLayerFilters(params: { layerId: string; filters: ; note: string; }): Promise<void>

    Sets the ephemeral filters for a layer.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    getLayerBoundaries()

    getLayerBoundaries(layerId: string): Promise<null | >

    Get the spatial boundaries that are filtering a layer.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<null | >

    hashtag
    Remarks

    The return type gives you the boundaries split up into the various sources that make up the overall boundary for a layer.

    The combined boundary is the intersection of the other sources of boundaries.

    hashtag
    Example


    hashtag
    setLayerBoundary()

    setLayerBoundary(params: { layerIds: string[]; boundary: null | ; }): Promise<void>

    Set the boundary for one or more layers.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<void>

    hashtag
    Example


    hashtag
    getRenderedFeatures()

    getRenderedFeatures(params?: ): Promise<[]>

    Get the features that are currently rendered on the map in the viewport.

    Note that this is explicitly about the features that are rendered, which isn't necessarily a complete list of all the features in the viewport. This is because of the way features are tiled: at low zoom levels or high feature densities, many features are omitted from what is rendered on the screen.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<[]>

    hashtag
    Example


    hashtag
    getFeature()

    getFeature(params: { id: string | number; layerId: string; }): Promise<null | >

    Get a feature from the map by its ID and layer ID.

    The response is a object, which does not include the geometry of the feature.

    You may want to use this when you don't need the geometry of a feature, but you know the ID of the feature you need.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<null | >

    hashtag
    Example


    hashtag
    getFeatures()

    getFeatures(params: { layerId: string; filters: ; sorting: ; boundary: ; search: string; pagination: null | string; pageSize

    Get a list of layer features.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<{ features: []; count: number; previousPage: null | string; nextPage: null | string; }>

    The response is an object which contains:

    • features: list of objects, which does not include the geometry of the feature but it does include its bounding box.

    • count: the total number of features that match the query.

    • previousPage &

    hashtag
    Remarks

    This list is paginated in sets of 20 features for each page. In order to paginate between pages, the response includes previousPage and nextPage that are tokens that should be sent in the pagination params for requesting sibling pages.

    Text search is case-insensitive and looks for matches across all feature properties.

    hashtag
    Example


    hashtag
    getGeoJsonFeature()

    getGeoJsonFeature(params: { id: string | number; layerId: string; }): Promise<null | >

    Get a feature in GeoJSON format from the map by its ID and layer ID.

    The response is a GeoJSON Feature object with the complete geometry of the feature. Note that for some very large geometries, the response may take a long time to return, and may return a very large object.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<null | >

    hashtag
    Example


    hashtag
    getCategoryData()

    getCategoryData(params: ): Promise<[]>

    Gets values from a layer grouped by a given attribute.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<[]>

    hashtag
    Remarks

    Groups features in your layer by unique values in the specified attribute and calculates a value for each group. By default, this value is the count of features in each group.

    You can apply filters in two ways:

    1. At the top level (using boundary and filters), which affects both what categories are included and how values are calculated

    2. In the values configuration, which only affects the values but keeps all categories

    This two-level filtering is particularly useful when you want to compare subsets of data while maintaining consistent categories. For example, you might want to show the distribution of all building types in a city, but only count buildings built after 2000 in each category.

    hashtag
    Example


    hashtag
    getHistogramData()

    getHistogramData(params: ): Promise<[]>

    Gets a histogram of values from a layer for a given attribute.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<[]>

    hashtag
    Remarks

    Creates bins (ranges) for numeric data and counts how many features fall into each bin, or returns aggregated values for each bin.

    You can control how the bins are created using the steps parameter, choosing from several methods like equal intervals, quantiles, or natural breaks (Jenks), or passing in the step values directly if you know how you want to bin the data.

    Like getCategoryData, you can apply filters in two ways:

    1. At the top level (using boundary and filters), which affects both how the bins are calculated and what features are counted in each bin

    2. In the values configuration, which only affects what gets counted but keeps the bin ranges the same

    This is particularly useful when you want to compare distributions while keeping consistent bin ranges. For example, you might want to compare the distribution of building heights in different years while using the same height ranges.

    hashtag
    Example


    hashtag
    getAggregates()

    getAggregates<T>(params: <T>): Promise<Record<T, null | number>>

    Calculates a single aggregate value for a layer based on the provided configuration.

    hashtag
    Type Parameters

    Type Parameter

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<Record<T, null | number>>

    hashtag
    Remarks

    Performs statistical calculations on your data, like counting features or computing averages, sums, etc. You can focus your calculation on specific areas or subsets of your data using boundaries and filters.

    When you request an aggregation other than count, you must specify an attribute to aggregate on.

    hashtag
    Example


    hashtag
    getPrecomputedAggregates()

    getPrecomputedAggregates(params: ): Promise<{ avg: null | number; max: null | number; min: null | number; sum

    Calculates aggregates for spatial cells of a layer.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<{ avg: null | number; max: null | number; min: null | number; sum: null | number;

    hashtag
    Remarks

    Performs statistical calculations on spatial cells of a layer, returning min, max, avg, sum, and count. You can focus your calculation on specific areas or subsets of your data using boundaries and filters. When using the count method, an attribute is not required.

    hashtag
    Example


    hashtag
    getLayerSchema()

    getLayerSchema(layerId: string): Promise<>

    Get the schema for a layer.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    Promise<>

    hashtag
    Remarks

    The schema describes the structure of the data in a layer, including the attributes that are available on the features in the layer.

    This can be useful to build generic UIs that need to know the structure of the data in a layer, such as a dropdown to choose an attribute.

    hashtag
    Example

    hashtag
    Events

    hashtag
    onLayerChange()

    onLayerChange(args: { options: { id: string; }; handler: (change: ) => void; }): VoidFunction

    Adds a listener for when a layer changes.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener

    hashtag
    Example


    hashtag
    onLayerGroupChange()

    onLayerGroupChange(args: { options: { id: string; }; handler: (change: ) => void; }): VoidFunction

    Adds a listener for when a layer group changes.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener

    hashtag
    Example


    hashtag
    onLegendItemChange()

    onLegendItemChange(args: { options: ; handler: (change: ) => void; }): VoidFunction

    Adds a listener for when a legend item changes.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener

    hashtag
    Example


    hashtag
    onLayerFiltersChange()

    onLayerFiltersChange(params: { options: { layerId: string; }; handler: (change: ) => void; }): VoidFunction

    Adds a listener for when a layer's filters change.

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener

    hashtag
    Remarks

    This event fires whenever any type of filter changes on the layer, including ephemeral filters set via the SDK, style-based filters, or filters set through the Felt UI via Components.

    hashtag
    Example


    hashtag
    onLayerBoundariesChange()

    onLayerBoundariesChange(params: { options: { layerId: string; }; handler: (boundaries: null | ) => void; }): VoidFunction

    Adds a listener for when a layer's spatial boundaries change.

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener

    hashtag
    Remarks

    This event fires whenever any type of spatial boundary changes on the layer, including ephemeral boundaries set via the SDK or boundaries set through the Felt UI via Spatial filter components.

    hashtag
    Example

    :
    number
    ;
    select
    :
    string
    []; }):
    Promise
    <{
    features
    :
    []; count: number; previousPage: null | string; nextPage: null | string; }>

    params.boundary?

    The spatial boundary to be applied.

    params.search?

    string

    Search term to search by. Search is case-insensitive and looks for matches across all feature properties.

    params.pagination?

    null | string

    Pagination token. It comes from either the previousPage or nextPage properties of the previous response.

    params.pageSize?

    number

    The number of features to return per page. Defaults to 20. Note: The larger the page size, the longer this is likely to take to respond.

    params.select?

    string[]

    The attributes to select from the features. If not provided, all attributes will be returned. If you set this to an empty array, no attributes will be returned.

    nextPage
    : The tokens to pass in the
    pagination
    param to navigate between pages.
    :
    null
    |
    number
    ;
    count
    :
    null
    |
    number
    ; }>
    count
    :
    null
    |
    number
    ; }>

    id

    string

    The id of the layer you want to get.

    constraint?

    GetLayersConstraint

    The constraints to apply to the layers returned from the map.

    visibility

    SetVisibilityRequest

    params

    { id: string; style: object; }

    -

    params.id

    string

    The id of the layer to set the style for.

    params.style

    object

    The style to set for the layer.

    params

    SetVisibilityRequest

    params

    CreateLayersFromGeoJsonParams

    params

    UpdateLayerParams

    id

    string

    id

    string

    id

    string

    constraint?

    GetLayerGroupsConstraint

    The constraints to apply to the layer groups returned from the map.

    visibility

    SetVisibilityRequest

    params

    SetVisibilityRequest

    id

    LegendItemIdentifier

    constraint?

    LegendItemsConstraint

    visibility

    { show: LegendItemIdentifier[]; hide: LegendItemIdentifier[]; }

    visibility.show?

    LegendItemIdentifier[]

    visibility.hide?

    LegendItemIdentifier[]

    layerId

    string

    params

    { layerId: string; filters: Filters; note: string; }

    -

    params.layerId

    string

    The layer that you want to set the filters for.

    params.filters

    Filters

    The filters to set for the layer. This will replace any ephemeral filters that are currently set for the layer.

    params.note?

    string

    A note to display on the layer legend when this filter is applied. When the note is shown, a reset button will also be shown, allowing the user to clear the filter.

    layerId

    string

    params

    { layerIds: string[]; boundary: null | GeometryFilter; }

    -

    params.layerIds

    string[]

    The ids of the layers to set the boundary for.

    params.boundary

    null | GeometryFilter

    The boundary to set for the layer. Passing null clears the ephemeral boundary for the layer.

    params?

    GetRenderedFeaturesConstraint

    The constraints to apply to the features returned from the map.

    params

    { id: string | number; layerId: string; }

    params.id

    string | number

    params.layerId

    string

    params

    { layerId: string; filters: Filters; sorting: SortConfig; boundary: GeometryFilter; search: string; pagination: null | string; pageSize: number; select: string[]; }

    -

    params.layerId

    string

    The ID of the layer to get features from.

    params.filters?

    Filters

    Filters to be applied. These filters will merge with layer's own filters.

    params.sorting?

    SortConfig

    Attribute to sort by.

    params

    { id: string | number; layerId: string; }

    params.id

    string | number

    params.layerId

    string

    params

    GetLayerCategoriesParams

    params

    GetLayerHistogramParams

    T extends "min" | "max" | "avg" | "sum" | "median" | "count"

    params

    GetLayerCalculationParams<T>

    params

    GetLayerPrecomputedCalculationParams

    layerId

    string

    args

    { options: { id: string; }; handler: (change: LayerChangeCallbackParams) => void; }

    -

    args.options

    { id: string; }

    -

    args.options.id

    string

    The id of the layer to listen for changes to.

    args.handler

    (change: LayerChangeCallbackParams) => void

    The handler that is called when the layer changes.

    args

    { options: { id: string; }; handler: (change: LayerGroupChangeCallbackParams) => void; }

    args.options

    { id: string; }

    args.options.id

    string

    args.handler

    (change: LayerGroupChangeCallbackParams) => void

    args

    { options: LegendItemIdentifier; handler: (change: LegendItemChangeCallbackParams) => void; }

    args.options

    LegendItemIdentifier

    args.handler

    (change: LegendItemChangeCallbackParams) => void

    params

    { options: { layerId: string; }; handler: (change: LayerFilters) => void; }

    params.options

    { layerId: string; }

    params.options.layerId

    string

    params.handler

    (change: LayerFilters) => void

    params

    { options: { layerId: string; }; handler: (boundaries: null | LayerBoundaries) => void; }

    -

    params.options

    { layerId: string; }

    -

    params.options.layerId

    string

    The id of the layer to listen for boundary changes on.

    params.handler

    (boundaries: null | LayerBoundaries) => void

    A function that is called when the boundaries change.

    FeltController
    Layer
    Layer
    GetLayersConstraint
    Layer
    Layer
    SetVisibilityRequest
    FSL documentationarrow-up-right
    SetVisibilityRequest
    CreateLayersFromGeoJsonParams
    LayerGroup
    Layer
    LayerGroup
    Layer
    UpdateLayerParams
    Layer
    UpdateLayerParams
    Layer
    Layer
    Layer
    LayerGroup
    LayerGroup
    GetLayerGroupsConstraint
    LayerGroup
    LayerGroup
    SetVisibilityRequest
    SetVisibilityRequest
    LegendItemIdentifier
    LegendItem
    LegendItem
    LegendItemsConstraint
    LegendItem
    LegendItem
    LegendItemIdentifier
    LegendItemIdentifier
    LayerFilters
    LayerFilters
    Filters
    LayerBoundaries
    LayerBoundaries
    GeometryFilter
    `ephemeral`
    GetRenderedFeaturesConstraint
    LayerFeature
    LayerFeature
    LayerFeature
    LayerFeature
    LayerFeature
    Filters
    SortConfig
    GeometryFilter
    LayerFeature
    LayerFeature
    GeoJsonFeature
    GeoJsonFeature
    GetLayerCategoriesParams
    GetLayerCategoriesGroup
    GetLayerCategoriesGroup
    GetLayerHistogramParams
    GetLayerHistogramBin
    GetLayerHistogramBin
    GetLayerCalculationParams
    GetLayerPrecomputedCalculationParams
    LayerSchema
    LayerSchema
    LayerChangeCallbackParams
    LayerGroupChangeCallbackParams
    LegendItemIdentifier
    LegendItemChangeCallbackParams
    LayerFilters
    LayerBoundaries
    LayerFeature
    const layer = await felt.getLayer("layer-1");
    const layers = await felt.getLayers();
    felt.setLayerVisibility({ show: ["layer-1", "layer-2"], hide: ["layer-3"] });
    // first get the current style
    const oldStyle = (await felt.getLayer("layer-1")).style;
    
    await felt.setLayerStyle({ id: "layer-1", style: {
      ...oldStyle,
      paint: {
        ...oldStyle.paint,
        color: "red",
      },
    } });
    felt.setLayerLegendVisibility({ show: ["layer-1", "layer-2"], hide: ["layer-3"] });
    const layerFromFile = await felt.createLayersFromGeoJson({
      source: {
        type: "geoJsonFile",
        file: someFile,
      },
      name: "Parcels",
    });
    
    const layerFromUrl = await felt.createLayersFromGeoJson({
      source: {
        type: "geoJsonUrl",
        url: "https://example.com/parcels.geojson",
      },
      name: "Parcels",
    await felt.updateLayer({
      id: "layer-1",
      name: "My Layer",
      caption: "A description of the layer",
    });
    await felt.deleteLayer("layer-1");
    const duplicatedLayer = await felt.duplicateLayer("layer-1");
    const layerGroup = await felt.getLayerGroup("layer-group-1");
    const layerGroups = await felt.getLayerGroups({ ids: ["layer-group-1", "layer-group-2"] });
    felt.setLayerGroupVisibility({ show: ["layer-group-1", "layer-group-2"], hide: ["layer-group-3"] });
    felt.setLayerGroupLegendVisibility({ show: ["layer-1", "layer-2"], hide: ["layer-3"] });
    const legendItem = await felt.getLegendItem({
      id: "legend-item-1",
      layerId: "layer-1",
    })
    const legendItems = await felt.getLegendItems({layerId: "layer-1"});
    felt.setLegendItemVisibility({
      show: [{layerId: "layer-group-1", id: "item-1-0"}],
      hide: [{layerId: "layer-group-2", id: "item-2-0"}],
    })
    const filters = await felt.getLayerFilters("layer-1");
    console.log(filters.combined, filters.style, filters.ephemeral, filters.components);
    await felt.setLayerFilters({
      layerId: "layer-1",
      filters: ["AREA", "gt", 30_000],
    });
    const boundaries = await felt.getLayerBoundaries("layer-1");
    
    console.log(boundaries?.combined);
    console.log(boundaries?.spatialFilters);
    console.log(boundaries?.ephemeral);
    await felt.setLayerBoundary({
      layerIds: ["layer-1", "layer-2"],
      boundary: { type: "MultiPolygon", coordinates: [[[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]]] }
    });
    const features = await felt.getRenderedFeatures();
    const feature = await felt.getFeature({ layerId: "layer-1", id: 123 });
    const page1Response = await felt.getFeatures({
      layerId: "layer-1",
      search: "abc123",
      pagination: undefined,
    });
    
    // Note that the search term here matches the one for the first page.
    if (page1Response.nextPage) {
      const page2Response = await felt.getFeatures({
        layerId: "layer-1",
        search: "abc123",
        pagination: page1Response.nextPage,
      });
    }
    const feature = await felt.getGeoJsonFeature({ layerId: "layer-1", id: 123 });
    // Basic grouping: Count of buildings by type
    const buildingsByType = await felt.getCategoryData({
      layerId: "buildings",
      attribute: "type"
    });
    
    // Filtered grouping: Only count buildings in downtown
    const downtownBuildingsByType = await felt.getCategoryData({
      layerId: "buildings",
      attribute: "type",
      boundary: [-122.43, 47.60, -122.33, 47.62]  // downtown boundary
    });
    
    // Advanced: Show all building types, but only sum floor area of recent buildings
    const recentBuildingAreaByType = await felt.getCategoryData({
      layerId: "buildings",
      attribute: "type",
      values: {
        filters: ["year_built", "gte", 2000],
        aggregation: {
          method: "sum",
          attribute: "floor_area"
        }
      }
    });
    
    // Compare residential density across neighborhoods while only counting recent buildings
    const newBuildingDensityByNeighborhood = await felt.getCategoryData({
      layerId: "buildings",
      attribute: "neighborhood",
      values: {
        filters: ["year_built", "gte", 2000],
        aggregation: {
          method: "avg",
          attribute: "units_per_acre"
        }
      }
    });
    // Basic histogram: Building heights in 5 natural break bins
    const buildingHeights = await felt.getHistogramData({
      layerId: "buildings",
      attribute: "height",
      steps: { type: "jenks", count: 5 }
    });
    
    // Compare old vs new buildings using the same height ranges
    const oldBuildingHeights = await felt.getHistogramData({
      layerId: "buildings",
      attribute: "height",
      steps: [0, 20, 50, 100, 200, 500],
      values: {
        filters: ["year_built", "lt", 1950]
      }
    });
    
    const newBuildingHeights = await felt.getHistogramData({
      layerId: "buildings",
      attribute: "height",
      steps: [0, 20, 50, 100, 200, 500],  // Same ranges as above
      values: {
        filters: ["year_built", "gte", 1950]
      }
    });
    // Count all residential buildings
    const residentialCount = await felt.getAggregates({
      layerId: "buildings",
      filters: ["type", "eq", "residential"],
      aggregation: {
        methods: ["count"],
      }
    });
    
    // Calculate average home value in a specific neighborhood
    const avgHomeValue = await felt.getAggregates({
      layerId: "buildings",
      boundary: [-122.43, 47.60, -122.33, 47.62],  // neighborhood boundary
      aggregation: {
        methods: ["avg"],
        attribute: "assessed_value"
      }
    });
    
    // Find the maximum building height for buildings built after 2000
    const maxNewBuildingHeight = await felt.getAggregates({
      layerId: "buildings",
      filters: ["year_built", "gte", 2000],
      aggregation: {
        methods: ["max"],
        attribute: "height"
      }
    });
    const aggregates = await felt.getPrecomputedAggregates({
      layerId: "buildings",
      gridConfig: {
        type: "h3",
        resolution: 10,
        method: "avg",
        attribute: "assessed_value"
      },
    });
    const schema = await felt.getLayerSchema("layer-1");
    const attributeIds = schema.attributes.map((attr) => attr.id);
    const unsubscribe = felt.onLayerChange({
      options: { id: "layer-1" },
      handler: ({layer}) => console.log(layer.bounds),
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onLayerGroupChange({
      options: { id: "layer-group-1" },
      handler: ({layerGroup}) => console.log(layerGroup.id),
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onLegendItemChange({
      options: { layerId: "layer-1", id: "item-1-0" },
      handler: ({legendItem}) => console.log(legendItem.visible),
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onLayerFiltersChange({
      options: { layerId: "layer-1" },
      handler: ({combined, ephemeral, style, components}) => {
        console.log("Layer filters updated:", {
          combined,  // All filters combined
          ephemeral, // Filters set via SDK
          style,     // Filters from layer style
          components // Filters from UI components
        });
      },
    });
    
    // later on...
    unsubscribe();
    const unsubscribe = felt.onLayerBoundariesChange({
      options: { layerId: "layer-1" },
      handler: ({combined, ephemeral, spatialFilters}) => {
        console.log("Layer boundaries updated:", {
          combined,  // All boundaries combined
          ephemeral, // Boundaries set via SDK
          spatialFilters // Boundaries set via UI
        });
      },
    });
    
    // later on...
    unsubscribe();
    GeometryFilter