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.
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.
Properties
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.
Properties
GeoJsonDataVectorSource
A GeoJSON data source is a layer that is populated from GeoJSON data, such as from a local file, or programmatically-created data.
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 .
id: string
A string identifying the element group.
name
name: string
The name of the element group. This is shown in the legend.
caption
caption: null | string
The caption of the element group. This is shown in the legend.
elementIds
elementIds: string[]
The ids of the elements in the element group.
Remarks
You can use these ids to get the full element objects via the `getElements` method.
visible
visible: boolean
Whether the element group is visible or not.
shownInLegend
shownInLegend: boolean
Whether the element group is shown in the legend or not.
id: string
A unique identifier for the basemap.
Remarks
Do not rely on the stability of this ID for Felt basemaps, as they are subject to change.
name
name: string
The name of the basemap.
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.
type
type: "xyz_tile"
tileUrl
tileUrl: string
attribution?
optionalattribution: string
The attribution of the basemap, which is shown in the map's UI.
ids?
optionalids: string[]
The ids of the elements to get.
attribute
attribute: string
The attribute to use for the aggregation. This must be a numeric attribute.
method
method: "min" | "max" | "avg" | "sum" | "median"
The method to use for the aggregation.
Type declaration
type
type: "felt"
Identifies this as a tiled vector source. Typically, these tiles will have been
uploaded to and processed by Felt.
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.
The resolution of the grid to use for the precomputed calculation.
type
type: "h3"
The type of grid to use for the precomputed calculation.
method
method: "count"
The method to use for the precomputed calculation, which in this case is always "count".
FeltBasemap
Properties
id
id: string
A unique identifier for the basemap.
Remarks
Do not rely on the stability of this ID for Felt basemaps, as they are subject to change.
name
name: string
The name of the basemap.
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.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
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.
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.
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.
type
type: "Image"
imageUrl
imageUrl: string
The URL of the image that is rendered in this element
opacity
opacity: number
The opacity of the image, between 0 and 1.
Default
interaction?
optionalinteraction: "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.
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
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
1.4.0
Minor Changes
555a25a: Add clearSelection method
1f5d950: Add option to pass auth token when embedding
1.3.0
Minor Changes
4bbde62: Allow setting a note to show with layer filters
1.2.0
Minor Changes
7badd4b: Add onMapIdle event
41efd53: Add selectFeature method to select feature by layer and feature ID
208c492: Add areaQuery param to getRenderedFeatures
1.1.0
Minor Changes
5f607ec: Return style with layers, and allow updating layer styles via setLayerStyle
Patch Changes
3a8bec8: Fix API reference link in README
1.0.2
Major Changes
Release v1 of Felt JS SDK
id: string
A unique identifier for the basemap.
Remarks
Do not rely on the stability of this ID for Felt basemaps, as they are subject to change.
name
name: string
The name of the basemap.
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.
type
type: "color"
color
color: string
attribution?
optionalattribution: string
The attribution of the basemap, which is shown in the map's UI.
id: string
A string identifying the layer group.
name
name: string
The name of the layer group. This is shown in the legend.
caption
caption: null | string
The caption of the layer group. This is shown in the legend.
layerIds
layerIds: string[]
The ids of the layers in the layer group.
Remarks
You can use these ids to get the full layer objects via the `getLayers` method.
visible
visible: boolean
Whether the layer group is visible or not.
shownInLegend
shownInLegend: boolean
Whether the layer group is shown in the legend or not.
bounds
bounds: null | [number, number, number, number]
The bounding box of the layer group in [west, south, east, north] order.
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.
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.
The new data for the element or null if the element was removed.
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.
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.
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: 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.
Default
zoom?
optionalzoom: 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.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
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.
type
type: "Image"
groupId?
optionalgroupId: 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.
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
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.
Controller
Interfaces
Type Aliases
Element Groups
Elements
LinkElementRead
Properties
id
id: string
The unique identifier for the element.
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.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
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.
type
type: "Link"
url
url: string
The URL of the link that is rendered in this element.
interaction?
optionalinteraction: "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.
Default
PathElementRead
Properties
id
id: string
The unique identifier for the element.
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.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
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.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity
strokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Default
strokeWidth
strokeWidth: number
The width of the element's stroke in pixels.
Default
strokeStyle
strokeStyle: "solid" | "dashed" | "dotted"
The style of the element's stroke.
Default
type
type: "Path"
distanceMarker
distanceMarker: boolean
Whether a distance marker is shown at the midpoint of the path.
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.
Default
endCaps
endCaps: boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode is set.
Default
interaction?
optionalinteraction: "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.
Default
MarkerElementCreate
Properties
type
type: "Marker"
coordinates
coordinates: [][]
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
opacity?
optionalopacity: number
The opacity of the marker, between 0 and 1.
Default
size?
optionalsize: number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
Default
zoom?
optionalzoom: 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
Properties
type
type: "Text"
text
text: string
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: 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.
Default
zoom?
optionalzoom: 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.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
The style of the text, either italic, light, regular or caps.
Default
position?
optionalposition:
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
Properties
type
type: "Highlighter"
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.
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
renderHoles?
optionalrenderHoles: boolean
Whether to render the holes of the highlighted area.
Default
opacity?
optionalopacity: number
The opacity of the highlighter, between 0 and 1.
Default
PlaceElementCreate
Properties
type
type: "Place"
coordinates
coordinates:
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
symbol?
optionalsymbol: 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.
The frame that is rendered around the Place's symbol. This is
only available for non-emoji symbols.
hideLabel?
optionalhideLabel: 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.
Default
MarkerElementUpdate
Properties
id
id: string
The unique identifier for the element.
type
type: "Marker"
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
opacity?
optionalopacity: number
The opacity of the marker, between 0 and 1.
Default
size?
optionalsize: number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
Default
zoom?
optionalzoom: 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.
coordinates?
optionalcoordinates: [][]
LayerBoundaries
All the different sources for boundaries for a layer, including their combined result.
Properties
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.
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.
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.
Type Parameters
Type Parameter
Textends | "count"
Properties
layerId
layerId: string
The ID of the layer to calculate an aggregate value for.
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.
filters?
optionalfilters:
Attribute filters for the features to include when calculating the aggregate value.
boundary?
optionalboundary:
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
Extended by
NoteElementRead
Properties
id
TextElementUpdate
Properties
id
NoteElementUpdate
Properties
id
TextElementRead
Properties
id
PlaceElementUpdate
Properties
id
CreateLayersFromGeoJsonParams
The parameters for the method.
Properties
GetLayerHistogramParams
The params used to request a histogram of values from a layer, passed to the method.
Properties
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.
The identifier of the feature, unique within the layer.
isDeterministicId
isDeterministicId: boolean
Whether the id is deterministic.
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.
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.
layerId
layerId: string
The identifier of the layer that the feature belongs to.
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.
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.
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
rotation
rotation: number
The rotation of the element in degrees.
Default
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.
Default
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.
text
text: string
The text in the element.
align
align: "center" | "left" | "right"
The alignment of the text, either left, center or right.
Default
style
style: "light" | "italic" | "regular" | "caps"
The style of the text, either italic, light, regular or caps.
Default
name
name: string
The text shown in the element, which is identical to the text property.
Remarks
This is added for consistency with other elements that have a name property.
The geographical position of the center of the note element.
interaction?
optionalinteraction: "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.
Default
id: string
The unique identifier for the element.
type
type: "Text"
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: 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.
Default
zoom?
optionalzoom: 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.
text?
optionaltext: string
The text in the element.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
The geographical position of the center of the text element.
id: string
The unique identifier for the element.
type
type: "Note"
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: 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.
Default
zoom?
optionalzoom: 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.
text?
optionaltext: string
The text in the element.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
The geographical position of the center of the note element.
id: string
The unique identifier for the element.
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.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
rotation
rotation: number
The rotation of the element in degrees.
Default
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.
Default
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.
text
text: string
The text in the element.
align
align: "center" | "left" | "right"
The alignment of the text, either left, center or right.
Default
style
style: "light" | "italic" | "regular" | "caps"
The style of the text, either italic, light, regular or caps.
Default
name
name: string
The text shown in the element, which is identical to the text property.
Remarks
This is added for consistency with other elements that have a name property.
The geographical position of the center of the text element.
interaction?
optionalinteraction: "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.
Default
id: string
The unique identifier for the element.
type
type: "Place"
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
symbol?
optionalsymbol: 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.
The frame that is rendered around the Place's symbol. This is
only available for non-emoji symbols.
hideLabel?
optionalhideLabel: 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.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
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.
type
type: "Marker"
opacity
opacity: number
The opacity of the marker, between 0 and 1.
Default
size
size: number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
Default
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.
interaction?
optionalinteraction: "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.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
The opacity of the polygon's fill, between 0 and 1.
Default
areaMarker?
optionalareaMarker: boolean
Whether to show an area marker on the polygon.
Default
id: string
The unique identifier for the element.
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.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
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.
type
type: "Highlighter"
renderHoles
renderHoles: boolean
Whether to render the holes of the highlighted area.
Default
opacity
opacity: number
The opacity of the highlighter, between 0 and 1.
Default
interaction?
optionalinteraction: "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.
Default
id: string
The unique identifier for the element.
type
type: "Highlighter"
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
renderHoles?
optionalrenderHoles: boolean
Whether to render the holes of the highlighted area.
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.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
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.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity
strokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Default
strokeWidth
strokeWidth: number
The width of the element's stroke in pixels.
Default
strokeStyle
strokeStyle: "solid" | "dashed" | "dotted"
The style of the element's stroke.
Default
type
type: "Circle"
radius
radius: number
The radius of the circle in meters.
radiusMarker
radiusMarker: boolean
Whether to show a marker on the circle that indicates the radius
Default
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.
The unit of the radius used when the radiusMarker is true.
A value of null means that the unit matches the user's locale.
Default
fillOpacity
fillOpacity: number
The opacity of the circle's fill.
Default
center
center:
The center of the circle.
interaction?
optionalinteraction: "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.
Default
CircleElementUpdate
Properties
id
id: string
The unique identifier for the element.
type
type: "Circle"
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Whether to show a marker on the circle that indicates the radius
Default
radiusDisplayAngle?
optionalradiusDisplayAngle: 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.
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.
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
Example
CircleElementCreate
Properties
type
type: "Circle"
radius
radius: number
The radius of the circle in meters.
center
center:
The center of the circle.
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Whether to show a marker on the circle that indicates the radius
Default
radiusDisplayAngle?
optionalradiusDisplayAngle: 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.
The unit of the radius used when the radiusMarker is true.
A value of null means that the unit matches the user's locale.
Default
fillOpacity?
optionalfillOpacity: number
The opacity of the circle's fill.
Default
PolygonElementUpdate
Properties
id
id: string
The unique identifier for the element.
type
type: "Polygon"
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
The opacity of the polygon's fill, between 0 and 1.
Default
areaMarker?
optionalareaMarker: boolean
Whether to show an area marker on the polygon.
Default
coordinates?
optionalcoordinates: [][]
PathElementCreate
Properties
type
type: "Path"
coordinates
coordinates: [][]
groupId?
optionalgroupId: 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.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
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.
Default
endCaps?
optionalendCaps: boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode is set.
Default
PlaceElementRead
Properties
id
id: string
The unique identifier for the element.
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.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
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.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
type
type: "Place"
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.
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.
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.
Default
coordinates
coordinates:
interaction?
optionalinteraction: "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.
Default
DataOnlyLayer
A data-only layer doesn't have any geometry, but can be used to join with other layers
Properties
id
id: string
A string identifying the layer
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.
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.
caption
caption: null | string
The layer's caption is shown in the legend.
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.
visible
visible: boolean
Whether the layer is visible or not.
shownInLegend
shownInLegend: boolean
Whether the layer is shown in the legend or not.
legendDisplay
legendDisplay: "default" | "nameOnly"
The display mode for the layer's legend.
See for more details.
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.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
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.
Default
endCaps?
optionalendCaps: boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode is set.
Default
coordinates?
optionalcoordinates: [][]
PolygonElementRead
Properties
id
id: string
The unique identifier for the element.
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.
color
color: string
The color of the element in some CSS-like format.
Example
Default
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.
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.
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.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity
strokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Default
strokeWidth
strokeWidth: number
The width of the element's stroke in pixels.
Default
strokeStyle
strokeStyle: "solid" | "dashed" | "dotted"
The style of the element's stroke.
Default
type
type: "Polygon"
fillOpacity
fillOpacity: number
The opacity of the polygon's fill, between 0 and 1.
Default
areaMarker
areaMarker: boolean
Whether to show an area marker on the polygon.
Default
interaction?
optionalinteraction: "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.
Default
LayerCommon
The common properties for all layers.
Properties
id
id: string
A string identifying the layer
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.
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.
caption
caption: null | string
The layer's caption is shown in the legend.
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.
visible
visible: boolean
Whether the layer is visible or not.
shownInLegend
shownInLegend: boolean
Whether the layer is shown in the legend or not.
legendDisplay
legendDisplay: "default" | "nameOnly"
The display mode for the layer's legend.
See for more details.
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.
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.
Properties
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.
displayName
displayName: string
The human-readable name of this attribute.
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.
distinctCount
distinctCount: number
The number of distinct values present for this attribute across all features.
type
type: "numeric"
Indicates this is a numeric attribute.
sampleValues
sampleValues: { value: number; count: number; }[]
A small sample of values for this attribute and their frequency.
Name
Type
min
min: number
The minimum value present for this attribute across all features.
max
max: number
The maximum value present for this attribute across all features.
ImageElementCreate
Properties
type
MapInteractionEvent
The event object passed to the interaction listeners.
Properties
LayerSchemaCommonAttribute
The common schema for all attributes.
Properties
LayerSchemaAttribute
LayerSchemaAttribute: | | | |
A single attribute from the layer schema.
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.
// 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();
The URL of the image that is rendered in this element
groupId?
optionalgroupId: 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.
name?
optionalname: 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.
description?
optionaldescription: 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.
attributes?
optionalattributes: 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.
interaction?
optionalinteraction: "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.
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.
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.
Controller
Features
Filters
Layer Groups
Layer Schema
Layer sources
Layers
Legend Items
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.
Extended by
Methods
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.
Returns
Promise<>
A promise that resolves to the current basemap configuration.
Example
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.
Returns
Promise<[]>
A promise that resolves to all basemaps available on the map.
Example
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().
Parameters
Parameter
Type
Returns
void
A promise that resolves when the basemap has been set.
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.
Parameters
Parameter
Type
Description
Returns
Promise<null | >
A promise that resolves to the requested element, or null if not found.
Example
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.
Parameters
Parameter
Type
Description
Returns
Promise<null | >
A promise that resolves to the element's geometry in GeoJSON format, or null if the element has no geometry.
Example
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.
Parameters
Parameter
Type
Description
Returns
Promise<(null | )[]>
A promise that resolves to an array of elements, ordered by the order specified in Felt.
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.
Example
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.
Parameters
Parameter
Type
Description
Returns
Promise<null | >
A promise that resolves to the requested element group, or null if not found.
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.
Parameters
Parameter
Type
Description
Returns
Promise<(null | )[]>
A promise that resolves to an array of element groups in rendering order.
Use this method to control the visibility of multiple element groups at once. This is more efficient than hiding/showing individual elements.
Parameters
Parameter
Type
Description
Returns
Promise<void>
A promise that resolves when the visibility changes are applied.
Example
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.
Parameters
Parameter
Type
Description
Returns
Promise<>
A promise that resolves to the created element.
Example
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.
Parameters
Parameter
Type
Description
Returns
Promise<>
A promise that resolves to the updated element.
Example
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.
Parameters
Parameter
Type
Description
Returns
Promise<void>
A promise that resolves when the element is deleted.
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.
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.
Parameters
Parameter
Type
Returns
VoidFunction
A function to unsubscribe from the listener.
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.
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.
Extended by
Methods
getLayer()
getLayer(id: string): Promise<null | >
Get a single layer from the map by its id.
Parameters
Parameter
Type
Description
Returns
Promise<null | >
The requested layer.
Example
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.
Parameters
Parameter
Type
Description
Returns
Promise<(null | )[]>
All layers on the map.
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.
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.
Parameters
Parameter
Type
Description
Returns
Promise<void>
Example
setLayerLegendVisibility()
setLayerLegendVisibility(params: ): Promise<void>
Hide or show layers with the given ids from the legend.
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.
Example
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.
Parameters
Parameter
Type
Returns
Promise<>
Example
deleteLayer()
deleteLayer(id: string): Promise<void>
Delete a layer from the map by its id.
Parameters
Parameter
Type
Returns
Promise<void>
Remarks
This only works for layers created via the SDK createLayersFromGeoJson method, not layers added via the Felt UI.
Example
duplicateLayer()
duplicateLayer(id: string): Promise<>
Duplicate a layer from the map by its id.
Parameters
Parameter
Type
Returns
Promise<>
The duplicated layer.
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.
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.
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.
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 &
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.
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.
Parameters
Parameter
Type
Returns
Promise<null | >
Example
getCategoryData()
getCategoryData(params: ): Promise<[]>
Gets values from a layer grouped by a given attribute.
Parameters
Parameter
Type
Returns
Promise<[]>
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:
At the top level (using boundary and filters), which affects both what categories are included and how values are calculated
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.
Example
getHistogramData()
getHistogramData(params: ): Promise<[]>
Gets a histogram of values from a layer for a given attribute.
Parameters
Parameter
Type
Returns
Promise<[]>
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:
At the top level (using boundary and filters), which affects both how the bins are calculated and what features are counted in each bin
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.
Calculates a single aggregate value for a layer based on the provided configuration.
Type Parameters
Type Parameter
Parameters
Parameter
Type
Returns
Promise<Record<T, null | number>>
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.
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.
Example
getLayerSchema()
getLayerSchema(layerId: string): Promise<>
Get the schema for a layer.
Parameters
Parameter
Type
Returns
Promise<>
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.
Adds a listener for when a layer's filters change.
Parameters
Parameter
Type
Returns
VoidFunction
A function to unsubscribe from the listener
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.
Adds a listener for when a layer's spatial boundaries change.
Parameters
Parameter
Type
Description
Returns
VoidFunction
A function to unsubscribe from the listener
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.
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.
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.
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,
});
}