Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
If you want to let your users create elements (as opposed to using the SDK to create them programmatically), you can use the to select and configure the drawing tools in Felt.
160ca6d: Implement getFeatures method on LayersController
6a1e536: Widen allowed boundary types
56077be: Add setLayerBoundary, getLayerBoundaries, onLayerBoundaryChange
ac68984: Update getLayerSchema example
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
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
555a25a: Add clearSelection method
1f5d950: Add option to pass auth token when embedding
4bbde62: Allow setting a note to show with layer filters
7badd4b: Add onMapIdle event
41efd53: Add selectFeature method to select feature by layer and feature ID
208c492: Add areaQuery param to getRenderedFeatures
5f607ec: Return style with layers, and allow updating layer styles via setLayerStyle
3a8bec8: Fix API reference link in README
Release v1 of Felt JS SDK
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
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:
"Highlighter"
renderHoles:
boolean
Whether to render the holes of the highlighted area.
opacity:
number
The opacity of the highlighter, between 0 and 1.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
id:
string
The unique identifier for the element.
type:
"Image"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
coordinates: [number
,number
][][] =MultiLineStringGeometrySchema.shape.coordinates
optional
imageUrl:string
The URL of the image that is rendered in this element
optional
opacity:number
The opacity of the image, between 0 and 1.
id:
string
The unique identifier for the element.
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.
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:
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:
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:
"Image"
imageUrl:
string
The URL of the image that is rendered in this element
opacity:
number
The opacity of the image, between 0 and 1.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
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:
"Link"
url:
string
The URL of the link that is rendered in this element.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
type:
"Image"
coordinates: [
number
,number
][][] =MultiLineStringGeometrySchema.shape.coordinates
imageUrl:
string
The URL of the image that is rendered in this element
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
opacity:number
The opacity of the image, between 0 and 1.
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
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:
"Marker"
opacity:
number
The opacity of the marker, between 0 and 1.
size:
number
The size of the marker, used in conjunction with the zoom
to determine
the actual size of the marker.
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
.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
id:
string
The unique identifier for the element.
type:
"Circle"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
strokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optional
strokeWidth:number
The width of the element's stroke in pixels.
optional
strokeStyle:"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
optional
radius:number
The radius of the circle in meters.
optional
radiusMarker:boolean
Whether to show a marker on the circle that indicates the radius
optional
radiusDisplayAngle:number
The angle at which the control point for setting the radius is displayed,
in degrees. When the radiusMarker
is true
, there is a dotted line rendered
from the center of the circle to the control point, and the marker is shown
at the midpoint of this line.
optional
radiusDisplayUnit:null
|"meter"
|"kilometer"
|"foot"
|"mile"
The unit of the radius used when the radiusMarker
is true
.
A value of null
means that the unit matches the user's locale.
optional
fillOpacity:number
The opacity of the circle's fill.
The center of the circle.
type:
"Circle"
radius:
number
The radius of the circle in meters.
The center of the circle.
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
strokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optional
strokeWidth:number
The width of the element's stroke in pixels.
optional
strokeStyle:"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
optional
radiusMarker:boolean
Whether to show a marker on the circle that indicates the radius
optional
radiusDisplayAngle:number
The angle at which the control point for setting the radius is displayed,
in degrees. When the radiusMarker
is true
, there is a dotted line rendered
from the center of the circle to the control point, and the marker is shown
at the midpoint of this line.
optional
radiusDisplayUnit:null
|"meter"
|"kilometer"
|"foot"
|"mile"
The unit of the radius used when the radiusMarker
is true
.
A value of null
means that the unit matches the user's locale.
optional
fillOpacity:number
The opacity of the circle's fill.
The new data for the element or null if the element was removed.
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 programatically, this will be false.
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
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:
null
|string
The URL of an image that has been added to the element.
strokeOpacity:
number
A value between 0 and 1 that describes the opacity of the element's stroke.
strokeWidth:
number
The width of the element's stroke in pixels.
strokeStyle:
"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
type:
"Circle"
radius:
number
The radius of the circle in meters.
radiusMarker:
boolean
Whether to show a marker on the circle that indicates the radius
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.
radiusDisplayUnit:
null
|"meter"
|"kilometer"
|"foot"
|"mile"
The unit of the radius used when the radiusMarker
is true
.
A value of null
means that the unit matches the user's locale.
fillOpacity:
number
The opacity of the circle's fill.
The center of the circle.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
id:
string
A string identifying the element group.
name:
string
The name of the element group. This is shown in the legend.
caption:
null
|string
The caption of the element group. This is shown in the legend.
elementIds:
string
[]
The ids of the elements in the element group.
visible:
boolean
Whether the element group is visible or not.
shownInLegend:
boolean
Whether the element group is shown in the legend or not.
The Elements controller allows you to get information about the elements on the map, and make changes to their visibility.
Get a single element from the map by its id.
id
string
The id of the element you want to get.
The requested element.
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
andradius
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.
Text, Note and Image elements do not return geometry, so will return null
.
id
string
The id of the element you want to get the geometry of.
Gets elements from the map, according to the constraints supplied. If no constraints are supplied, all elements will be returned.
constraint
?
The constraints to apply to the elements returned from the map.
All elements on the map.
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.
Get an element group from the map by its id.
id
string
The requested element group.
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.
constraint
?
The constraints to apply to the element groups returned from the map.
The requested element groups.
Hide or show element groups with the given ids.
visibility
Promise
<void
>
Create a new element on the map.
element
Update an element on the map.
element
deleteElement(
id
:string
):Promise
<void
>
Delete an element from the map.
id
string
Promise
<void
>
Adds a listener for when an element is created.
args
-
args.handler
VoidFunction
A function to unsubscribe from the listener
Listens for when a new element is finished being created by a drawing tool.
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.
args
-
args.handler
The handler to call whenever this event fires.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when an element changes.
This will fire when an element is being edited, either on the map by the user or programatically.
args
-
args.options
{ id
: string
; }
-
args.options.id
string
The id of the element to listen for changes to.
args.handler
The handler that is called when the element changes.
VoidFunction
A function to unsubscribe from the listener
onElementDelete(
args
: {options
: {id
:string
; };handler
: () =>void
; }):VoidFunction
Adds a listener for when an element is deleted.
args
{ options
: { id
: string
; }; handler
: () => void
; }
-
args.options
{ id
: string
; }
-
args.options.id
string
The id of the element to listen for deletions of.
args.handler
() => void
The handler that is called when the element is deleted.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when an element group changes.
args
args.options
{ id
: string
; }
args.options.id
string
args.handler
VoidFunction
A function to unsubscribe from the listener
type:
"Highlighter"
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.
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
renderHoles:boolean
Whether to render the holes of the highlighted area.
optional
opacity:number
The opacity of the highlighter, between 0 and 1.
id:
string
The unique identifier for the element.
type:
"Highlighter"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
renderHoles:boolean
Whether to render the holes of the highlighted area.
optional
opacity:number
The opacity of the highlighter, between 0 and 1.
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.
type:
"Marker"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
opacity:number
The opacity of the marker, between 0 and 1.
optional
size:number
The size of the marker, used in conjunction with the zoom
to determine
the actual size of the marker.
optional
zoom:number
The zoom level at which the marker was created. This is combined with
the size
to determine the actual size of the marker.
When creating a marker, if you don't supply this value it defaults to
the current zoom of the map when you call createElement
.
id:
string
The unique identifier for the element.
type:
"Marker"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
opacity:number
The opacity of the marker, between 0 and 1.
optional
size:number
The size of the marker, used in conjunction with the zoom
to determine
the actual size of the marker.
optional
zoom:number
The zoom level at which the marker was created. This is combined with
the size
to determine the actual size of the marker.
When creating a marker, if you don't supply this value it defaults to
the current zoom of the map when you call createElement
.
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
number
The rotation of the element in degrees.
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.
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:
string
The text in the element.
align:
"center"
|"left"
|"right"
The alignment of the text, either left
, center
or right
.
style:
"italic"
|"light"
|"regular"
|"caps"
The style of the text, either italic
, light
, regular
or caps
.
name:
string
The text shown in the element, which is identical to the text
property.
This is added for consistency with other elements that have a name
property.
type:
"Note"
widthScale:
number
The geographical position of the center of the note element.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
type:
"Note"
text:
string
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
rotation:number
The rotation of the element in degrees.
optional
scale:number
The relative scale of the element from the default size. This is combined
with the zoom
to determine the actual size of the element.
optional
zoom:number
The zoom level at which the element was created. This is combined with
the scale
to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to
the current zoom of the map when you call createElement
.
optional
align:"center"
|"left"
|"right"
The alignment of the text, either left
, center
or right
.
optional
style:"italic"
|"light"
|"regular"
|"caps"
The style of the text, either italic
, light
, regular
or caps
.
optional
widthScale:number
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.
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:
string
The color of the element in some CSS-like format.
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:
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:
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:
null
|string
The URL of an image that has been added to the element.
strokeOpacity:
number
A value between 0 and 1 that describes the opacity of the element's stroke.
strokeWidth:
number
The width of the element's stroke in pixels.
strokeStyle:
"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
type:
"Path"
distanceMarker:
boolean
Whether a distance marker is shown at the midpoint of the path.
routingMode:
null
|"driving"
|"cycling"
|"walking"
|"flying"
Whether this represents a route, and if so, what mode of transport is used.
If this is null
, the path is not considered to be a route, so while it
can have a distanceMarker
, it will does not have a start or end cap.
endCaps:
boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode
is set.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
id:
string
The unique identifier for the element.
type:
"Place"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
symbol:string
The symbol that is rendered for the Place.
This can be an emoji by using colon-enclosed characters (e.g. ":smiley:"
)
or one of the symbols available in Felt's symbol library.
You can see the available symbols in the Felt UI when editing a Place
by hovering a symbol and converting the tooltip to kebab-case. For example,
the "Oil barrel" symbol is oil-barrel
.
optional
frame:null
|"frame-circle"
|"frame-square"
The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.
optional
hideLabel:boolean
Whether the element's label is hidden on the map. This allows you to add a name to the element and can show in popups, but not have it visible on the map.
This will also hide the faint placeholder label that is shown when an editable Place is selected.
id:
string
The unique identifier for the element.
type:
"Note"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
rotation:number
The rotation of the element in degrees.
optional
scale:number
The relative scale of the element from the default size. This is combined
with the zoom
to determine the actual size of the element.
optional
zoom:number
The zoom level at which the element was created. This is combined with
the scale
to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to
the current zoom of the map when you call createElement
.
optional
text:string
The text in the element.
optional
align:"center"
|"left"
|"right"
The alignment of the text, either left
, center
or right
.
optional
style:"italic"
|"light"
|"regular"
|"caps"
The style of the text, either italic
, light
, regular
or caps
.
optional
widthScale:number
The geographical position of the center of the note element.
id:
string
The unique identifier for the element.
type:
"Path"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
strokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optional
strokeWidth:number
The width of the element's stroke in pixels.
optional
strokeStyle:"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
optional
distanceMarker:boolean
Whether a distance marker is shown at the midpoint of the path.
optional
routingMode:null
|"driving"
|"cycling"
|"walking"
|"flying"
Whether this represents a route, and if so, what mode of transport is used.
If this is null
, the path is not considered to be a route, so while it
can have a distanceMarker
, it will does not have a start or end cap.
optional
endCaps:boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode
is set.
type:
"Path"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
strokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optional
strokeWidth:number
The width of the element's stroke in pixels.
optional
strokeStyle:"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
optional
distanceMarker:boolean
Whether a distance marker is shown at the midpoint of the path.
optional
routingMode:null
|"driving"
|"cycling"
|"walking"
|"flying"
Whether this represents a route, and if so, what mode of transport is used.
If this is null
, the path is not considered to be a route, so while it
can have a distanceMarker
, it will does not have a start or end cap.
optional
endCaps:boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode
is set.
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
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:
null
|string
The URL of an image that has been added to the element.
type:
"Place"
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:
null
|"frame-circle"
|"frame-square"
The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.
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.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
type:
"Polygon"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
strokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optional
strokeWidth:number
The width of the element's stroke in pixels.
optional
strokeStyle:"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
optional
fillOpacity:number
The opacity of the polygon's fill, between 0 and 1.
optional
areaMarker:boolean
Whether to show an area marker on the polygon.
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
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:
null
|string
The URL of an image that has been added to the element.
strokeOpacity:
number
A value between 0 and 1 that describes the opacity of the element's stroke.
strokeWidth:
number
The width of the element's stroke in pixels.
strokeStyle:
"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
type:
"Polygon"
fillOpacity:
number
The opacity of the polygon's fill, between 0 and 1.
areaMarker:
boolean
Whether to show an area marker on the polygon.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
id:
string
The unique identifier for the element.
type:
"Polygon"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
strokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optional
strokeWidth:number
The width of the element's stroke in pixels.
optional
strokeStyle:"solid"
|"dashed"
|"dotted"
The style of the element's stroke.
optional
fillOpacity:number
The opacity of the polygon's fill, between 0 and 1.
optional
areaMarker:boolean
Whether to show an area marker on the polygon.
type:
"Place"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
name:null
|string
The element's name. For elements that can show a label or text on the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when the element is selected by clicking on it.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
imageUrl:null
|string
The URL of an image that has been added to the element.
optional
symbol:string
The symbol that is rendered for the Place.
This can be an emoji by using colon-enclosed characters (e.g. ":smiley:"
)
or one of the symbols available in Felt's symbol library.
You can see the available symbols in the Felt UI when editing a Place
by hovering a symbol and converting the tooltip to kebab-case. For example,
the "Oil barrel" symbol is oil-barrel
.
optional
frame:null
|"frame-circle"
|"frame-square"
The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.
optional
hideLabel:boolean
Whether the element's label is hidden on the map. This allows you to add a name to the element and can show in popups, but not have it visible on the map.
This will also hide the faint placeholder label that is shown when an editable Place is selected.
View for a complete list of available functions. enumerates initialization options.
optional
center:
center:
ElementCreate: | | | | | | | |
The parameters for the and the listeners.
element: null
|
Element: | | | | | | | | |
The parameters for the listener.
elementGroup: null
|
center:
You can use these ids to get the full element objects via the method.
ElementUpdate: | | | | | | | |
getElement(id
: string
): Promise
<null
| >
Promise
<null
| >
getElementGeometry(id
: string
): Promise
<null
| >
Promise
<null
| >
getElements(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
getElementGroup(id
: string
): Promise
<null
| >
Promise
<null
| >
getElementGroups(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setElementGroupVisibility(visibility
: ): Promise
<void
>
createElement(element
: ): Promise
<>
Promise
<>
updateElement(element
: ): Promise
<>
Promise
<>
onElementCreate(args
: { handler
: (change
: ) => void
; }): VoidFunction
{ handler
: (change
: ) => void
; }
(change
: ) => void
The handler that is called when an element is created. This will fire when elements are created programatically, 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.
onElementCreateEnd(args
: { handler
: (params
: { element
: ; }) => void
; }): VoidFunction
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.
{ handler
: (params
: { element
: ; }) => void
; }
(params
: { element
: ; }) => void
onElementChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
Like the listener, this will fire when an element is still being created by a drawing tool.
You can check the property to determine if the element is still being created by a drawing tool.
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
onElementGroupChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
coordinates: [][][]
optional
coordinates: [][][]
coordinates: [][]
optional
coordinates: [][]
position:
optional
position:
optional
coordinates:
optional
position:
optional
coordinates: [][]
coordinates: [][]
coordinates:
coordinates: [][]
optional
coordinates: [][]
coordinates:
AggregationMethod:
"avg"
|"max"
|"min"
|"sum"
|"median"
The method to use for the aggregation.
FilterExpression: [
null
|string
,"in"
|"ni"
,null
| (null
|string
|number
|boolean
)[]] | [null
|string
,"lt"
|"gt"
|"le"
|"ge"
|"eq"
|"ne"
|"cn"
|"nc"
|"is"
|"isnt"
,null
|string
|number
|boolean
]
FilterLogicGate:
"and"
|"or"
FeltTiledVectorSource: {
type
:"felt"
;tileTemplateUrl
:string
; }
A tiled vector source is a layer that is populated from data the has been uploaded to Felt, and processed into vector tiles.
type:
"felt"
Identifies this as a tiled vector source. Typically, these tiles will have been uploaded to and processed by Felt.
tileTemplateUrl:
string
The template URL used for fetching tiles.
type:
"Text"
text:
string
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
rotation:number
The rotation of the element in degrees.
optional
scale:number
The relative scale of the element from the default size. This is combined
with the zoom
to determine the actual size of the element.
optional
zoom:number
The zoom level at which the element was created. This is combined with
the scale
to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to
the current zoom of the map when you call createElement
.
optional
align:"center"
|"left"
|"right"
The alignment of the text, either left
, center
or right
.
optional
style:"italic"
|"light"
|"regular"
|"caps"
The style of the text, either italic
, light
, regular
or caps
.
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.
The Interactions controller allows you to observe interactions with the map
Allows you to be notified the user clicks on the map.
params
params.handler
VoidFunction
A function to unsubscribe from the listener
Allows you to be notified the user moves the mouse over the map.
params
Params for the listener
params.handler
The handler function
VoidFunction
A function to unsubscribe from the listener
The event object passed to the interaction listeners.
The cursor position in world coordinates.
point: {
x
:number
;y
:number
; }
The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
x
number
y
number
The vector features that are under the cursor.
The raster pixel values that are under the cursor.
id:
string
The unique identifier for the element.
type:
"Text"
optional
groupId:null
|string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
optional
color:string
The color of the element in some CSS-like format.
optional
description:null
|string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
optional
attributes:Record
<string
,unknown
>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
optional
rotation:number
The rotation of the element in degrees.
optional
scale:number
The relative scale of the element from the default size. This is combined
with the zoom
to determine the actual size of the element.
optional
zoom:number
The zoom level at which the element was created. This is combined with
the scale
to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to
the current zoom of the map when you call createElement
.
optional
text:string
The text in the element.
optional
align:"center"
|"left"
|"right"
The alignment of the text, either left
, center
or right
.
optional
style:"italic"
|"light"
|"regular"
|"caps"
The style of the text, either italic
, light
, regular
or caps
.
The geographical position of the center of the text element.
id:
string
The unique identifier for the element.
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:
string
The color of the element in some CSS-like format.
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:
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:
number
The rotation of the element in degrees.
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.
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:
string
The text in the element.
align:
"center"
|"left"
|"right"
The alignment of the text, either left
, center
or right
.
style:
"italic"
|"light"
|"regular"
|"caps"
The style of the text, either italic
, light
, regular
or caps
.
name:
string
The text shown in the element, which is identical to the text
property.
This is added for consistency with other elements that have a name
property.
type:
"Text"
The geographical position of the center of the text element.
optional
interaction:"default"
|"locked"
Whether the element is interactive.
The default
interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked
, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
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.
name:
string
The name of the layer to create.
The source of the GeoJSON data.
optional
bounds: [number
,number
,number
,number
]
Sets the bounds of the layer.
optional
caption:string
Sets the caption of the layer.
optional
description:string
Sets the description of the layer.
optional
geometryStyles: {Point
:object
;Line
:object
;Polygon
:object
; }
The styles to apply to each geometry on the layer.
These are optional, and if missing will use a default style determined by Felt, which you can consider to be undefined behaviour.
Point
?
object
Line
?
object
Polygon
?
object
A data-only layer doesn't have any geometry, but can be used to join with other layers
id:
string
A string identifying the layer
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:
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:
null
|string
The layer's caption is shown in the legend.
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:
boolean
Whether the layer is visible or not.
shownInLegend:
boolean
Whether the layer is shown in the legend or not.
style:
object
The FSL style for the layer.
As the types of the styles are very complex, we return object
here and advise that you
program defensively while reading the styles.
status:
"processing"
|"completed"
|"failed"
|"incomplete"
The current processing status of the layer.
geometryType:
null
Indicates that this layer has no geometry.
bounds:
null
This is always null for data-only layers.
See the examples below for the correct structure to use when building complex filters.
The possible operators are:
lt
: Less than
gt
: Greater than
le
: Less than or equal to
ge
: Greater than or equal to
eq
: Equal to
ne
: Not equal to
cn
: Contains
nc
: Does not contain
The allowed boolean operators are:
and
: Logical AND
or
: Logical OR
The common type for filtering data by a spatial boundary.
This can be either:
FeltBoundary
: a [w, s, e, n] bounding box
PolygonGeometry
: a GeoJSON Polygon geometry
MultiPolygonGeometry
: a GeoJSON MultiPolygon geometry
LngLatTuple[]
: a list of coordinates describing a single ring of a polygon
layerId:
string
attribute:
string
steps:
number
[] | {type
:"equal-intervals"
;count
:number
; } | {type
:"time-interval"
;interval
:"hour"
|"day"
|"week"
|"month"
|"year"
; }
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.
Attribute filters for the features to include when calculating the histogram bins.
The spatial boundary for the features to include when calculating the histogram bins.
The filters that are currently set on a layer.
A layer's filters are the combination of various different places in which filters can be applied.
Filters that are set in the layer's style. These are the lowest level of filters, and can only be set by editing the map.
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.
The combined result of all the filters set on the layer.
The common properties for all layers.
id:
string
A string identifying the layer
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:
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:
null
|string
The layer's caption is shown in the legend.
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:
boolean
Whether the layer is visible or not.
shownInLegend:
boolean
Whether the layer is shown in the legend or not.
style:
object
The FSL style for the layer.
As the types of the styles are very complex, we return object
here and advise that you
program defensively while reading the styles.
status:
"processing"
|"completed"
|"failed"
|"incomplete"
The current processing status of the layer.
bounds:
null
| [number
,number
,number
,number
]
The bounding box of the layer in [west, south, east, north] order
There are cases where the bounds are not available, such as for layers added to the map from URL sources, as these are not (depending on their type) processed and analyzed by Felt.
optional
position:
onPointerClick(params
: { handler
: (event
: ) => void
; }): VoidFunction
{ handler
: (event
: ) => void
; }
(event
: ) => void
onPointerMove(params
: { handler
: (event
: ) => void
; }): VoidFunction
{ handler
: (event
: ) => void
; }
(event
: ) => void
coordinate:
features: []
rasterValues: []
optional
position:
position:
You can control the visibility of layers, layer groups, and legend items using the, , and methods.
The parameters for the method.
source: | |
Each style should be a valid FSL style, as described in .
See the for details on how to read and write styles.
Filters: | | null
| boolean
Filters can be used to change which features in a layer are rendered. Filters can be applied to a layer by the method on the Felt controller.
Filters use a tree structure for combining expressions with logical operators, called a. When combining three or more conditions, you must use proper nesting rather than a flat list.
FilterTernary: [ | | null
| boolean
, , | | null
| boolean
]
GeometryFilter: | | | []
This is an input-only type. It is converted to a when passed to .
Layer: | |
The params used to request a histogram of values from a layer, passed to the method.
optional
values: { boundary
: [number
, number
][] | [number
, number
, number
, number
] | { type
: "Polygon"
; coordinates
: [number
, number
][][]; } | { type
: "MultiPolygon"
; coordinates
: [number
, number
][][][]; }; filters
: null
| boolean
| [null
| string
, "in"
| "ni"
, null
| (null
| string
| number
| boolean
)[]] | [null
| string
, "lt"
| "gt"
| "le"
| "ge"
| "eq"
| "ne"
| "cn"
| "nc"
| "is"
| "isnt"
, null
| string
| number
| boolean
] | ; aggregation
: { method
: "avg"
| "max"
| "min"
| "sum"
| "median"
; attribute
: string
; }; }
optional
filters:
optional
boundary:
The parameters for the listener.
layer: null
|
style:
components:
ephemeral:
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:
See the for details on how to read and write styles.
One bin from the response from the method.
LayerProcessingStatus:
"processing"
|"completed"
|"failed"
|"incomplete"
This describes the processing status of a layer.
The various values are:
processing
: The layer has been uploaded or updated and is still processing.
completed
: The layer has been processed and can be viewed on the map.
failed
: The layer failed to process and cannot be viewed on the map.
incomplete
: The layer has not been processed.
boundary
?
[number
, number
][] | [number
, number
, number
, number
] | { type
: "Polygon"
; coordinates
: [number
, number
][][]; } | { type
: "MultiPolygon"
; coordinates
: [number
, number
][][][]; }
-
-
filters
?
-
-
aggregation
?
{ method
: "avg"
| "max"
| "min"
| "sum"
| "median"
; attribute
: string
; }
-
-
aggregation.method
"avg"
| "max"
| "min"
| "sum"
| "median"
AggregateMethodSchema
The operation to use on the values from the features in the layer
aggregation.attribute
string
-
The attribute to use for the aggregation. This must be a numeric attribute.
id:
string
A string identifying the layer group.
name:
string
The name of the layer group. This is shown in the legend.
caption:
null
|string
The caption of the layer group. This is shown in the legend.
layerIds:
string
[]
The ids of the layers in the layer group.
visible:
boolean
Whether the layer group is visible or not.
shownInLegend:
boolean
Whether the layer group is shown in the legend or not.
bounds:
null
| [number
,number
,number
,number
]
The bounding box of the layer group in [west, south, east, north] order.
A legend item, which often represents a sub-class of features in a layer in the case of categorical or classed layers.
title:
string
|string
[]
The title of the legend item.
titleDependsOnZoom:
boolean
visible:
boolean
Whether the legend item is visible or not.
id:
string
The id of the legend item.
layerId:
string
The id of the layer the legend item belongs to.
The schema for a datetime attribute on a layer.
id:
string
The unique identifier for this attribute.
displayName:
string
The human-readable name of this attribute.
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:
number
The number of distinct values present for this attribute across all features.
type:
"datetime"
Indicates this is a datetime attribute.
min:
string
The earliest datetime present for this attribute in ISO8601 format.
max:
string
The latest datetime present for this attribute in ISO8601 format.
sampleValues: {
value
:string
;count
:number
; }[]
A representative sample of datetime values for this attribute and their frequency.
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.
Get a single layer from the map by its id.
The requested layer.
Gets layers from the map, according to the constraints supplied. If no constraints are supplied, all layers will be returned.
All layers on the map.
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.
Hide or show layers with the given ids.
Promise
<void
>
setLayerStyle(
params
: {id
:string
;style
:object
; }):Promise
<void
>
Set the style for a layer using FSL, the Felt Style Language.
Changes are only for this session, and not persisted. This is useful to make temporary changes to a layer's style, such as to highlight a particular layer or feature.
If the style you set is invalid, you will receive an error explaining the problem in the rejected promise value.
Promise
<void
>
Hide or show layers with the given ids from the legend.
Promise
<void
>
Adds layers to the map from file or URL sources.
The layer groups that were created.
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.
Update a layer by passing a subset of the layer's properties.
deleteLayer(
id
:string
):Promise
<void
>
Delete a layer from the map by its id.
Promise
<void
>
This only works for layers created via the SDK createLayersFromGeoJson
method, not layers added via the Felt UI.
Get a layer group from the map by its id.
The requested layer group.
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.
The requested layer groups.
Hide or show layer groups with the given ids.
Promise
<void
>
Hide or show layer groups with the given ids from the legend.
Promise
<void
>
Allows you to get the state of a single legend item.
Allows you to obtain the state of several legend items, by passing in constraints describing which legend items you want.
If you do not pass any constraints, you will receive all legend items.
Hide or show legend items with the given identifiers.
Promise
<void
>
Get the filters for a layer.
The return type gives you the filters split up into the various sources that make up the overall filters for a layer.
Sets the ephemeral filters for a layer.
Promise
<void
>
Get the spatial boundaries that are filtering a layer.
The return type gives you the boundaries split up into the various sources that make up the overall boundary for a layer.
The combined boundary is the intersection of the other sources of boundaries.
Promise
<void
>
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.
Get a feature from the map by its ID and layer ID.
You may want to use this when you don't need the geometry of a feature, but you know the ID of the feature you need.
Get a list of layer features.
The response is an object which contains:
count
: the total number of features that match the query.
previousPage
& nextPage
: The tokens to pass in the pagination
param
to navigate between pages.
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.
Gets values from a layer grouped by a given attribute.
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.
Gets a histogram of values from a layer for a given attribute.
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.
Promise
<Record
<T
, null
| number
>>
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 no aggregation is specified, it counts features. When an aggregation is provided, it performs that calculation (average, sum, etc.) on the specified attribute.
Get the schema for a layer.
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 changes.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when a layer group changes.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when a legend item changes.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when a layer's filters change.
VoidFunction
A function to unsubscribe from the listener
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.
VoidFunction
A function to unsubscribe from the listener
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.
Defines how to aggregate a value across features in a layer with multiple aggregations returned at once.
methods:
T
[]
The operations to use on the values from the features in the layer
optional
attribute:string
The attribute to use for the aggregation when aggregations other than "count" are used.
This can be omitted if the only aggregation is "count", but must be a numeric attribute otherwise.
null
| boolean
| [null
| string
, "in"
| "ni"
, null
| (null
| string
| number
| boolean
)[]] | [null
| string
, "lt"
| "gt"
| "le"
| "ge"
| "eq"
| "ne"
| "cn"
| "nc"
| "is"
| "isnt"
, null
| string
| number
| boolean
] |
The parameters for the listener.
layerGroup: null
|
You can use these ids to get the full layer objects via the method.
Whether the title depends on the zoom level or not. If it does, you need to call when the zoom level changes.
Note that as the zoom level changes, the handler will not be called, so you need to call yourself.
The parameters for the listener.
legendItem: null
|
This can be used to fetch statistics, categories, histograms etc. for this attribute via the , , and methods.
getLayer(id
: string
): Promise
<null
| >
Promise
<null
| >
getLayers(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setLayerVisibility(visibility
: ): Promise
<void
>
See the for details on how to read and write styles.
setLayerLegendVisibility(params
: ): Promise
<void
>
createLayersFromGeoJson(params
: ): Promise
<null
| { layerGroup
: ; layers
: []; }>
Promise
<null
| { layerGroup
: ; layers
: []; }>
updateLayer(params
: ): Promise
<>
Note that not all properties can be updated, so check the type to see which properties can be updated.
Promise
<>
getLayerGroup(id
: string
): Promise
<null
| >
Promise
<null
| >
getLayerGroups(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setLayerGroupVisibility(visibility
: ): Promise
<void
>
setLayerGroupLegendVisibility(params
: ): Promise
<void
>
getLegendItem(id
: ): Promise
<null
| >
Promise
<null
| >
getLegendItems(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setLegendItemVisibility(visibility
: { show
: []; hide
: []; }): Promise
<void
>
getLayerFilters(layerId
: string
): Promise
<null
| >
Promise
<null
| >
setLayerFilters(params
: { layerId
: string
; filters
: ; note
: string
; }): Promise
<void
>
getLayerBoundaries(layerId
: string
): Promise
<null
| >
Promise
<null
| >
setLayerBoundary(params
: { layerIds
: string
[]; boundary
: null
| ; }): Promise
<void
>
Set the boundary for one or more layers.
getRenderedFeatures(params
?: ): Promise
<[]>
Promise
<[]>
getFeature(params
: { id
: string
| number
; layerId
: string
; }): Promise
<null
| >
The response is a object, which does not include the geometry of the feature.
Promise
<null
| >
getFeatures(params
: { layerId
: string
; filters
: ; sorting
: ; boundary
: ; search
: string
; pagination
: null
| string
; }): Promise
<{ features
: []; count
: number
; previousPage
: null
| string
; nextPage
: null
| string
; }>
Promise
<{ features
: []; count
: number
; previousPage
: null
| string
; nextPage
: null
| string
; }>
features
: list of objects, which does not include
the geometry of the feature but it does include its bounding box.
getGeoJsonFeature(params
: { id
: string
| number
; layerId
: string
; }): Promise
<null
| >
Promise
<null
| >
getCategoryData(params
: ): Promise
<[]>
Promise
<[]>
getHistogramData(params
: ): Promise
<[]>
Promise
<[]>
getAggregates<T
>(params
: <T
>): Promise
<Record
<T
, null
| number
>>
getLayerSchema(layerId
: string
): Promise
<>
Promise
<>
onLayerChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
onLayerGroupChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
onLegendItemChange(args
: { options
: ; handler
: (change
: ) => void
; }): VoidFunction
onLayerFiltersChange(params
: { options
: { layerId
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
onLayerBoundariesChange(params
: { options
: { layerId
: string
; }; handler
: (boundaries
: null
| ) => void
; }): VoidFunction
id
string
The id of the legend item.
layerId
string
The id of the layer the legend item belongs to.
value
string
count
number
id
string
The id of the layer you want to get.
params
{ id
: string
; style
: object
; }
-
params.id
string
The id of the layer to set the style for.
params.style
object
The style to set for the layer.
id
string
id
string
layerId
string
layerId
string
params
{ id
: string
| number
; layerId
: string
; }
params.id
string
| number
params.layerId
string
params
{ id
: string
| number
; layerId
: string
; }
params.id
string
| number
params.layerId
string
T
extends "avg"
| "max"
| "min"
| "sum"
| "median"
| "count"
layerId
string
A raster pixel value for a specific layer.
value:
number
The value of the pixel.
layerId:
string
The ID of the layer that the pixel belongs to.
categoryName:
null
|string
The name of the category that the pixel belongs to.
color:
null
| {r
:number
;g
:number
;b
:number
;a
:number
; }
The color of the pixel. Each value is between 0 and 255.
constraint
?
The constraints to apply to the layers returned from the map.
visibility
params
params
params
constraint
?
The constraints to apply to the layer groups returned from the map.
visibility
params
id
constraint
?
visibility
visibility.show
?
visibility.hide
?
params
-
params.layerId
string
The layer that you want to set the filters for.
params.filters
The filters to set for the layer. This will replace any ephemeral filters that are currently set for the layer.
params.note
?
string
A note to display on the layer legend when this filter is applied. When the note is shown, a reset button will also be shown, allowing the user to clear the filter.
params
-
params.layerIds
string
[]
The ids of the layers to set the boundary for.
params.boundary
The boundary to set for the layer. Passing null
clears the ephemeral boundary for the layer.
params
?
The constraints to apply to the features returned from the map.
params
-
params.layerId
string
The ID of the layer to get features from.
params.filters
?
Filters to be applied. These filters will merge with layer's own filters.
params.sorting
?
Attribute to sort by.
params.boundary
?
The spatial boundary to be applied.
params.search
?
string
Search term to search by. Search is case-insensitive and looks for matches across all feature properties.
params.pagination
?
null
| string
Pagination token. It comes from either the previousPage
or nextPage
properties of the previous response.
params
params
params
args
-
args.options
{ id
: string
; }
-
args.options.id
string
The id of the layer to listen for changes to.
args.handler
The handler that is called when the layer changes.
args
args.options
{ id
: string
; }
args.options.id
string
args.handler
args
args.options
args.handler
params
params.options
{ layerId
: string
; }
params.options.layerId
string
params.handler
params
-
params.options
{ layerId
: string
; }
-
params.options.layerId
string
The id of the layer to listen for boundary changes on.
params.handler
A function that is called when the boundaries change.
A raster layer is a layer that contains raster data that can be rendered on the map
id:
string
A string identifying the layer
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:
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:
null
|string
The layer's caption is shown in the legend.
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:
boolean
Whether the layer is visible or not.
shownInLegend:
boolean
Whether the layer is shown in the legend or not.
style:
object
The FSL style for the layer.
As the types of the styles are very complex, we return object
here and advise that you
program defensively while reading the styles.
status:
"processing"
|"completed"
|"failed"
|"incomplete"
The current processing status of the layer.
bounds:
null
| [number
,number
,number
,number
]
The bounding box of the layer in [west, south, east, north] order
There are cases where the bounds are not available, such as for layers added to the map from URL sources, as these are not (depending on their type) processed and analyzed by Felt.
geometryType:
"Raster"
Identifies the type of geometry in the layer.
The source of the raster layer's data.
Configuration for filtering and aggregating values across features.
This can be used to restrict the features considered for aggregation via the boundary
and filters
properties.
It can also be used to specify how to aggregate the values via the aggregation
property.
The spatial boundary for what to count or aggregate.
Attribute filters to determine what gets counted or aggregated.
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.
For example, instead of counting buildings in each category, you might want to sum their square footage or average their assessed values.
The source of a raster layer's data.
imageTileTemplateUrl:
string
A URL template for fetching image tiles for the raster.
encodedTileTemplateUrl:
string
A URL template for fetching encoded tiles for the raster.
The encoded raster value can be calculated from the red, green, and blue values of the pixel using the following formula:
or
List of encoded raster bands
T
extends | "count"
{ show
: []; hide
: []; }
[]
[]
{ layerId
: string
; filters
: ; note
: string
; }
{ layerIds
: string
[]; boundary
: null
| ; }
null
|
{ layerId
: string
; filters
: ; sorting
: ; boundary
: ; search
: string
; pagination
: null
| string
; }
<T
>
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
{ options
: ; handler
: (change
: ) => void
; }
(change
: ) => void
{ options
: { layerId
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
{ options
: { layerId
: string
; }; handler
: (boundaries
: null
| ) => void
; }
(boundaries
: null
| ) => void
See the for details on how to read and write styles.
source:
optional
boundary:
optional
filters:
optional
aggregation:
Use the object to embed a new iframe, or connect to an existing embedded iframe.
Once you have connected to a Felt map (either by embedding or connecting to an existing iframe), you can use the object to control the map.
To see what you can do with the map, see the documentation for the interface and its constituent controllers.
bands: []
This is the main interface for interacting with a Felt map.
This interface is composed of the various controllers, each having a different area of responsibility.
All the methods are listed here, but each controller is documented on its own to make it easier to find related methods and events.
Get a single element from the map by its id.
id
string
The id of the element you want to get.
The requested element.
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
andradius
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.
Text, Note and Image elements do not return geometry, so will return null
.
id
string
The id of the element you want to get the geometry of.
Gets elements from the map, according to the constraints supplied. If no constraints are supplied, all elements will be returned.
constraint
?
The constraints to apply to the elements returned from the map.
All elements on the map.
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.
Get an element group from the map by its id.
id
string
The requested element group.
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.
constraint
?
The constraints to apply to the element groups returned from the map.
The requested element groups.
Hide or show element groups with the given ids.
visibility
Promise
<void
>
Create a new element on the map.
element
Update an element on the map.
element
deleteElement(
id
:string
):Promise
<void
>
Delete an element from the map.
id
string
Promise
<void
>
Get a single layer from the map by its id.
id
string
The id of the layer you want to get.
The requested layer.
Gets layers from the map, according to the constraints supplied. If no constraints are supplied, all layers will be returned.
constraint
?
The constraints to apply to the layers returned from the map.
All layers on the map.
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.
Hide or show layers with the given ids.
visibility
Promise
<void
>
setLayerStyle(
params
: {id
:string
;style
:object
; }):Promise
<void
>
Set the style for a layer using FSL, the Felt Style Language.
Changes are only for this session, and not persisted. This is useful to make temporary changes to a layer's style, such as to highlight a particular layer or feature.
If the style you set is invalid, you will receive an error explaining the problem in the rejected promise value.
params
{ id
: string
; style
: object
; }
-
params.id
string
The id of the layer to set the style for.
params.style
object
The style to set for the layer.
Promise
<void
>
Hide or show layers with the given ids from the legend.
params
Promise
<void
>
Adds layers to the map from file or URL sources.
params
The layer groups that were created.
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.
Update a layer by passing a subset of the layer's properties.
params
deleteLayer(
id
:string
):Promise
<void
>
Delete a layer from the map by its id.
id
string
Promise
<void
>
This only works for layers created via the SDK createLayersFromGeoJson
method, not layers added via the Felt UI.
Get a layer group from the map by its id.
id
string
The requested layer group.
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.
constraint
?
The constraints to apply to the layer groups returned from the map.
The requested layer groups.
Hide or show layer groups with the given ids.
visibility
Promise
<void
>
Hide or show layer groups with the given ids from the legend.
params
Promise
<void
>
Allows you to get the state of a single legend item.
id
Allows you to obtain the state of several legend items, by passing in constraints describing which legend items you want.
If you do not pass any constraints, you will receive all legend items.
constraint
?
Hide or show legend items with the given identifiers.
visibility
visibility.show
?
visibility.hide
?
Promise
<void
>
Get the filters for a layer.
layerId
string
The return type gives you the filters split up into the various sources that make up the overall filters for a layer.
Sets the ephemeral filters for a layer.
params
-
params.layerId
string
The layer that you want to set the filters for.
params.filters
The filters to set for the layer. This will replace any ephemeral filters that are currently set for the layer.
params.note
?
string
A note to display on the layer legend when this filter is applied. When the note is shown, a reset button will also be shown, allowing the user to clear the filter.
Promise
<void
>
Get the spatial boundaries that are filtering a layer.
layerId
string
The return type gives you the boundaries split up into the various sources that make up the overall boundary for a layer.
The combined boundary is the intersection of the other sources of boundaries.
params
-
params.layerIds
string
[]
The ids of the layers to set the boundary for.
params.boundary
The boundary to set for the layer. Passing null
clears the ephemeral boundary for the layer.
Promise
<void
>
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.
params
?
The constraints to apply to the features returned from the map.
Get a feature from the map by its ID and layer ID.
You may want to use this when you don't need the geometry of a feature, but you know the ID of the feature you need.
params
{ id
: string
| number
; layerId
: string
; }
params.id
string
| number
params.layerId
string
Get a list of layer features.
params
-
params.layerId
string
The ID of the layer to get features from.
params.filters
?
Filters to be applied. These filters will merge with layer's own filters.
params.sorting
?
Attribute to sort by.
params.boundary
?
The spatial boundary to be applied.
params.search
?
string
Search term to search by. Search is case-insensitive and looks for matches across all feature properties.
params.pagination
?
null
| string
Pagination token. It comes from either the previousPage
or nextPage
properties of the previous response.
The response is an object which contains:
count
: the total number of features that match the query.
previousPage
& nextPage
: The tokens to pass in the pagination
param
to navigate between pages.
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.
params
{ id
: string
| number
; layerId
: string
; }
params.id
string
| number
params.layerId
string
Gets values from a layer grouped by a given attribute.
params
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.
Gets a histogram of values from a layer for a given attribute.
params
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.
T
extends "avg"
| "max"
| "min"
| "sum"
| "median"
| "count"
params
Promise
<Record
<T
, null
| number
>>
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 no aggregation is specified, it counts features. When an aggregation is provided, it performs that calculation (average, sum, etc.) on the specified attribute.
Get the schema for a layer.
layerId
string
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.
Gets the details of the map.
Gets the current selection as a list of entity identifiers.
Selects a feature on a layer. This will show the feature's popup, modal or sidebar (if configured) and highlight the feature.
params
Promise
<void
>
clearSelection(
params
?: {features
:boolean
;elements
:boolean
; }):Promise
<void
>
Clears the current selection. This clears the selection of
params
?
{ features
: boolean
; elements
: boolean
; }
The parameters to clear the selection. If this is not provided, both features and elements will be cleared.
params.features
?
boolean
Whether to clear the features from the selection.
params.elements
?
boolean
Whether to clear the elements from the selection.
Promise
<void
>
setTool(
tool
:null
|"text"
|"link"
|"note"
|"pin"
|"line"
|"route"
|"polygon"
|"circle"
|"marker"
|"highlighter"
):void
Sets the tool to use for drawing elements on the map.
tool
null
| "text"
| "link"
| "note"
| "pin"
| "line"
| "route"
| "polygon"
| "circle"
| "marker"
| "highlighter"
The tool to set.
void
getTool():
Promise
<null
|"text"
|"link"
|"note"
|"pin"
|"line"
|"route"
|"polygon"
|"circle"
|"marker"
|"highlighter"
>
Gets the current tool, if any is in use.
Promise
<null
| "text"
| "link"
| "note"
| "pin"
| "line"
| "route"
| "polygon"
| "circle"
| "marker"
| "highlighter"
>
The current tool, or null
if no tool is in use.
onToolChange(
args
: {handler
: (tool
:null
|"text"
|"link"
|"note"
|"pin"
|"line"
|"route"
|"polygon"
|"circle"
|"marker"
|"highlighter"
) =>void
; }):VoidFunction
Listens for changes to the current tool.
args
{ handler
: (tool
: null
| "text"
| "link"
| "note"
| "pin"
| "line"
| "route"
| "polygon"
| "circle"
| "marker"
| "highlighter"
) => void
; }
-
args.handler
(tool
: null
| "text"
| "link"
| "note"
| "pin"
| "line"
| "route"
| "polygon"
| "circle"
| "marker"
| "highlighter"
) => void
This callback is called with the current tool whenever the tool changes.
VoidFunction
A function to unsubscribe from the listener
Sets the settings for the current tool.
settings
The settings to set.
void
Gets the settings for the chosen tool
tool
T
The settings for the chosen tool.
Listens for changes to the settings on all tools.
args
args.handler
VoidFunction
A function to unsubscribe from the listener
Updates the UI controls on the embedded map.
controls
The controls to update.
void
Control the on-map UI shown when interacting with features and elements.
If you add your own click, selection or hover handlers you may want to disable various parts of the Felt UI. This method allows you to control the visibility of various parts of the UI that might otherwise be shown when people click or hover on things.
This does not affect selection. That means that selectable features and elements will still be selected when clicked.
options
void
Shows a data table view for the specified layer, optionally sorted by a given attribute.
params
?
params.layerId
?
string
params.sorting
?
Promise
<void
>
hideLayerDataTable():
Promise
<void
>
Hides the data table.
Promise
<void
>
Gets the current state of the viewport.
Moves the map to the specified location.
viewport
void
Gets the current state of the viewport constraints.
Constrains the map viewport so it stays inside certain bounds and/or certain zoom levels.
constraints
void
every constraint is optional
if a constraint is null, it will be removed but keeping the others
if method receives null, it will remove the constraints
Fits the map to the specified bounds.
bounds
void
Adds a listener for when an element is created.
args
-
args.handler
VoidFunction
A function to unsubscribe from the listener
Listens for when a new element is finished being created by a drawing tool.
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.
args
-
args.handler
The handler to call whenever this event fires.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when an element changes.
This will fire when an element is being edited, either on the map by the user or programatically.
args
-
args.options
{ id
: string
; }
-
args.options.id
string
The id of the element to listen for changes to.
args.handler
The handler that is called when the element changes.
VoidFunction
A function to unsubscribe from the listener
onElementDelete(
args
: {options
: {id
:string
; };handler
: () =>void
; }):VoidFunction
Adds a listener for when an element is deleted.
args
{ options
: { id
: string
; }; handler
: () => void
; }
-
args.options
{ id
: string
; }
-
args.options.id
string
The id of the element to listen for deletions of.
args.handler
() => void
The handler that is called when the element is deleted.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when an element group changes.
args
args.options
{ id
: string
; }
args.options.id
string
args.handler
VoidFunction
A function to unsubscribe from the listener
Allows you to be notified the user clicks on the map.
params
params.handler
VoidFunction
A function to unsubscribe from the listener
Allows you to be notified the user moves the mouse over the map.
params
Params for the listener
params.handler
The handler function
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when a layer changes.
args
-
args.options
{ id
: string
; }
-
args.options.id
string
The id of the layer to listen for changes to.
args.handler
The handler that is called when the layer changes.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when a layer group changes.
args
args.options
{ id
: string
; }
args.options.id
string
args.handler
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when a legend item changes.
args
args.options
args.handler
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when a layer's filters change.
params
params.options
{ layerId
: string
; }
params.options.layerId
string
params.handler
VoidFunction
A function to unsubscribe from the listener
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.
params
-
params.options
{ layerId
: string
; }
-
params.options.layerId
string
The id of the layer to listen for boundary changes on.
params.handler
A function that is called when the boundaries change.
VoidFunction
A function to unsubscribe from the listener
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.
Adds a listener for when the selection changes.
params
params.handler
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when the viewport changes.
args
-
args.handler
This callback is called with the current viewport state whenever the viewport changes.
VoidFunction
A function to unsubscribe from the listener
Adds a listener for when the viewport move ends, which is when the user stops dragging or zooming the map, animations have finished, or inertial dragging ends.
args
args.handler
VoidFunction
A function to unsubscribe from the listener
onMapIdle(
args
: {handler
: () =>void
; }):VoidFunction
Adds a listener for when the map is idle, which is defined as:
No transitions are in progress
The user is not interacting with the map, e.g. by panning or zooming
All tiles for the current viewport have been loaded
Any fade transitions (e.g. for labels) have completed
args
{ handler
: () => void
; }
args.handler
() => void
VoidFunction
A function to unsubscribe from the listener
readonly
iframe:null
|HTMLIFrameElement
The iframe element containing the Felt map, if it is an embedded map.
.......
getElement(id
: string
): Promise
<null
| >
Promise
<null
| >
getElementGeometry(id
: string
): Promise
<null
| >
Promise
<null
| >
getElements(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
getElementGroup(id
: string
): Promise
<null
| >
Promise
<null
| >
getElementGroups(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setElementGroupVisibility(visibility
: ): Promise
<void
>
createElement(element
: ): Promise
<>
Promise
<>
updateElement(element
: ): Promise
<>
Promise
<>
getLayer(id
: string
): Promise
<null
| >
Promise
<null
| >
getLayers(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setLayerVisibility(visibility
: ): Promise
<void
>
See the for details on how to read and write styles.
setLayerLegendVisibility(params
: ): Promise
<void
>
createLayersFromGeoJson(params
: ): Promise
<null
| { layerGroup
: ; layers
: []; }>
Promise
<null
| { layerGroup
: ; layers
: []; }>
updateLayer(params
: ): Promise
<>
Note that not all properties can be updated, so check the type to see which properties can be updated.
Promise
<>
getLayerGroup(id
: string
): Promise
<null
| >
Promise
<null
| >
getLayerGroups(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setLayerGroupVisibility(visibility
: ): Promise
<void
>
setLayerGroupLegendVisibility(params
: ): Promise
<void
>
getLegendItem(id
: ): Promise
<null
| >
Promise
<null
| >
getLegendItems(constraint
?: ): Promise
<(null
| )[]>
Promise
<(null
| )[]>
setLegendItemVisibility(visibility
: { show
: []; hide
: []; }): Promise
<void
>
{ show
: []; hide
: []; }
[]
[]
getLayerFilters(layerId
: string
): Promise
<null
| >
Promise
<null
| >
setLayerFilters(params
: { layerId
: string
; filters
: ; note
: string
; }): Promise
<void
>
{ layerId
: string
; filters
: ; note
: string
; }
getLayerBoundaries(layerId
: string
): Promise
<null
| >
Promise
<null
| >
setLayerBoundary(params
: { layerIds
: string
[]; boundary
: null
| ; }): Promise
<void
>
Set the boundary for one or more layers.
{ layerIds
: string
[]; boundary
: null
| ; }
null
|
getRenderedFeatures(params
?: ): Promise
<[]>
Promise
<[]>
getFeature(params
: { id
: string
| number
; layerId
: string
; }): Promise
<null
| >
The response is a object, which does not include the geometry of the feature.
Promise
<null
| >
getFeatures(params
: { layerId
: string
; filters
: ; sorting
: ; boundary
: ; search
: string
; pagination
: null
| string
; }): Promise
<{ features
: []; count
: number
; previousPage
: null
| string
; nextPage
: null
| string
; }>
{ layerId
: string
; filters
: ; sorting
: ; boundary
: ; search
: string
; pagination
: null
| string
; }
Promise
<{ features
: []; count
: number
; previousPage
: null
| string
; nextPage
: null
| string
; }>
features
: list of objects, which does not include
the geometry of the feature but it does include its bounding box.
getGeoJsonFeature(params
: { id
: string
| number
; layerId
: string
; }): Promise
<null
| >
Promise
<null
| >
getCategoryData(params
: ): Promise
<[]>
Promise
<[]>
getHistogramData(params
: ): Promise
<[]>
Promise
<[]>
getAggregates<T
>(params
: <T
>): Promise
<Record
<T
, null
| number
>>
<T
>
getLayerSchema(layerId
: string
): Promise
<>
Promise
<>
getMapDetails(): Promise
<>
Promise
<>
getSelection(): Promise
<[]>
Promise
<[]>
selectFeature(params
: ): Promise
<void
>
setToolSettings(settings
: ): void
getToolSettings<T
>(tool
: T
): Promise
<[T
]>
T
extends keyof
Promise
<[T
]>
onToolSettingsChange(args
: { handler
: (settings
: ) => void
; }): VoidFunction
{ handler
: (settings
: ) => void
; }
(settings
: ) => void
updateUiControls(controls
: ): void
setOnMapInteractionsUi(options
: ): void
showLayerDataTable(params
?: { layerId
: string
; sorting
: ; }): Promise
<void
>
{ layerId
: string
; sorting
: ; }
getViewport(): Promise
<>
Promise
<>
setViewport(viewport
: ): void
getViewportConstraints(): Promise
<null
| >
Promise
<null
| >
setViewportConstraints(constraints
: null
| Partial
<>): void
null
| Partial
<>
fitViewportToBounds(bounds
: ): void
onElementCreate(args
: { handler
: (change
: ) => void
; }): VoidFunction
{ handler
: (change
: ) => void
; }
(change
: ) => void
The handler that is called when an element is created. This will fire when elements are created programatically, 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.
onElementCreateEnd(args
: { handler
: (params
: { element
: ; }) => void
; }): VoidFunction
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.
{ handler
: (params
: { element
: ; }) => void
; }
(params
: { element
: ; }) => void
onElementChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
Like the listener, this will fire when an element is still being created by a drawing tool.
You can check the property to determine if the element is still being created by a drawing tool.
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
onElementGroupChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
onPointerClick(params
: { handler
: (event
: ) => void
; }): VoidFunction
{ handler
: (event
: ) => void
; }
(event
: ) => void
onPointerMove(params
: { handler
: (event
: ) => void
; }): VoidFunction
{ handler
: (event
: ) => void
; }
(event
: ) => void
onLayerChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
onLayerGroupChange(args
: { options
: { id
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
{ options
: { id
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
onLegendItemChange(args
: { options
: ; handler
: (change
: ) => void
; }): VoidFunction
{ options
: ; handler
: (change
: ) => void
; }
(change
: ) => void
onLayerFiltersChange(params
: { options
: { layerId
: string
; }; handler
: (change
: ) => void
; }): VoidFunction
{ options
: { layerId
: string
; }; handler
: (change
: ) => void
; }
(change
: ) => void
onLayerBoundariesChange(params
: { options
: { layerId
: string
; }; handler
: (boundaries
: null
| ) => void
; }): VoidFunction
{ options
: { layerId
: string
; }; handler
: (boundaries
: null
| ) => void
; }
(boundaries
: null
| ) => void
onSelectionChange(params
: { handler
: (change
: { selection
: []; }) => void
; }): VoidFunction
{ handler
: (change
: { selection
: []; }) => void
; }
(change
: { selection
: []; }) => void
onViewportMove(args
: { handler
: (viewport
: ) => void
; }): VoidFunction
{ handler
: (viewport
: ) => void
; }
(viewport
: ) => void
onViewportMoveEnd(args
: { handler
: (viewport
: ) => void
; }): VoidFunction
{ handler
: (viewport
: ) => void
; }
(viewport
: ) => void
layerId:
string
The ID of the layer to get categories from.
attribute:
string
The attribute to use for categorization.
optional
limit:number
The maximum number of categories to return.
Attribute filters for the features to include when calculating the categories.
The spatial boundary for the features to include when calculating the categories.
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 parameters for getting categories from a layer, passed to the method.
optional
filters:
optional
boundary:
optional
values:
layerId:
string
The ID of the layer to calculate an aggregate value for.
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.
Attribute filters for the features to include when calculating the aggregate value.
The spatial boundary for the features to include when calculating the aggregate value.
The parameters for calculating a single aggregate value for a layer, passed to the method.
T
extends | "count"
aggregation: <T
>
optional
filters:
optional
boundary:
A GeoJSON URL source is a layer that is populated from a GeoJSON file at a remote URL.
These sources are ones that have not been uploaded to and processed by Felt, and as such their capabilities are limited.
For instance, they cannot be filtered, nor can statistics be fetched for them.
type:
"geoJsonUrl"
Identifies this as a GeoJSON URL source.
url:
string
The remote URL of the GeoJSON file used to populate the layer.
optional
refreshInterval:null
|number
The interval in milliseconds between automatic refreshes of the GeoJSON.
The value must be in the range of 250ms - 5 minutes (300,000ms).
If the value is null
, the GeoJSON will not be refreshed automatically.
All the different sources for boundaries for a layer, including their combined result.
Boundaries set by drawing spatial filters on the map.
When there are multiple spatial filters, they are combined into a multi-polygon.
Boundaries that are set ephemerally by viewers in their own session.
The combined result of all the boundaries set on the layer.
Each different source of boundary is intersected to produce the combined result.
spatialFilters: null
|
ephemeral: null
|
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: null
|
A LayerFeature is a single geographical item in a layer.
id:
string
|number
The identifier of the feature, unique within the layer.
layerId:
string
The identifier of the layer that the feature belongs to.
geometryType:
"Polygon"
|"MultiPolygon"
|"LineString"
|"MultiLineString"
|"Point"
|"MultiPoint"
|string
& {}
The type of geometry of the feature.
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.
bbox:
undefined
| [number
,number
,number
,number
]
The bounding box of the feature.
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 properties of the feature, as a bag of attributes.
key:
string
|number
|boolean
The category for which the value was calculated.
value:
null
|number
The value calculated for the category, whether a count, sum, average, etc.
null
is returned if there are no features in the category as opposed to zero,
so as not to confuse with a real zero value from some aggregation.
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.
Because LayerFeatures can be read from tiled features, it's
possible that this geometryType
won't match the geometry.type
of the returned by .
properties:
A single category from the response from the method.
Constraints for the method. This can include layer constriants, spatial constraints, or both. If no constraints are provided, all rendered features will be returned.
optional
areaQuery: { coordinates
: ; } | { boundary
: [number
, number
, number
, number
]; }
The area to query for rendered features. This can be specific coordinates or a . If omitted, the entire viewport will be queried.
The schema that describes the structure of the features in a 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.
featureCount:
number
The total number of features in the layer.
Array of attribute schemas describing the properties available on features in this layer.
attributes: []
LayerSchemaAttribute: | | | |
The schema for a numeric attribute on a layer.
id:
string
The unique identifier for this attribute.
displayName:
string
The human-readable name of this attribute.
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:
number
The number of distinct values present for this attribute across all features.
type:
"numeric"
Indicates this is a numeric attribute.
sampleValues: {
value
:number
;count
:number
; }[]
A small sample of values for this attribute and their frequency.
value
number
count
number
min:
number
The minimum value present for this attribute across all features.
max:
number
The maximum value present for this attribute across all features.
This can be used to fetch statistics, categories, histograms etc. for this attribute via the , , and methods.
The common schema for all attributes.
id:
string
The unique identifier for this attribute.
displayName:
string
The human-readable name of this attribute.
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:
number
The number of distinct values present for this attribute across all features.
The schema for a date attribute on a layer.
id:
string
The unique identifier for this attribute.
displayName:
string
The human-readable name of this attribute.
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:
number
The number of distinct values present for this attribute across all features.
type:
"date"
Indicates this is a date attribute.
min:
string
The earliest date present for this attribute in truncated ISO8601 format (YYYY-MM-DD).
max:
string
The latest date present for this attribute in truncated ISO8601 format (YYYY-MM-DD).
sampleValues: {
value
:string
;count
:number
; }[]
A representative sample of date values for this attribute and their frequency.
value
string
count
number
The schema for a text attribute on a layer.
id:
string
The unique identifier for this attribute.
displayName:
string
The human-readable name of this attribute.
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:
number
The number of distinct values present for this attribute across all features.
type:
"text"
Indicates this is a text attribute.
sampleValues: {
value
:string
;count
:number
; }[]
A small sample of string values for this attribute and their frequency.
value
string
count
number
The schema for a boolean attribute on a layer.
id:
string
The unique identifier for this attribute.
displayName:
string
The human-readable name of this attribute.
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:
number
The number of distinct values present for this attribute across all features.
type:
"boolean"
Indicates this is a boolean attribute.
sampleValues: {
value
:boolean
;count
:number
; }[]
A representative sample of boolean values for this attribute and their frequency.
value
boolean
count
number
This can be used to fetch statistics, categories, histograms etc. for this attribute via the , , and methods.
This can be used to fetch statistics, categories, histograms etc. for this attribute via the , , and methods.
This can be used to fetch statistics, categories, histograms etc. for this attribute via the , , and methods.
This can be used to fetch statistics, categories, histograms etc. for this attribute via the , , and methods.
A vector layer is a layer that contains vector data that can be rendered on the map
id:
string
A string identifying the layer
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:
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:
null
|string
The layer's caption is shown in the legend.
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:
boolean
Whether the layer is visible or not.
shownInLegend:
boolean
Whether the layer is shown in the legend or not.
style:
object
The FSL style for the layer.
As the types of the styles are very complex, we return object
here and advise that you
program defensively while reading the styles.
status:
"processing"
|"completed"
|"failed"
|"incomplete"
The current processing status of the layer.
bounds:
null
| [number
,number
,number
,number
]
The bounding box of the layer in [west, south, east, north] order
There are cases where the bounds are not available, such as for layers added to the map from URL sources, as these are not (depending on their type) processed and analyzed by Felt.
geometryType:
"Polygon"
|"Point"
|"Line"
Identifies the type of geometry in the layer.
The source of the vector layer's data.
See the for details on how to read and write styles.
source: | | Omit
<, "data"
>
The RasterBand interface describes the metadata for a raster band, necessary for calculating the encoded raster value from the red, green, and blue values of the pixel.
base:
number
Encoding base value as a floating point number
interval:
number
Encoding interval as a floating point number
bandIndex:
number
1-based index of the band in the raster
optional
uiControls:
optional
initialViewport:
const
Felt: { embed
: Promise
<>; connect
: Promise
<>; }
Embeds a Felt map into the provided container, returning a promise that resolves to a object that you can use to control the map.
Promise
<>
A promise for a .
Promise
<>
feltWindow
Pick
<Window
, "postMessage"
>
The iframe element containing the Felt map.
container
HTMLElement
The container element to embed the map into.
mapId
string
The ID of the map to embed.
options
?
The options to configure the map.
id:
string
The id of the layer to update.
optional
shownInLegend:boolean
Changes whether the layer is shown in the legend.
optional
name:string
Changes the name of the layer.
optional
caption:string
Changes the caption of the layer.
optional
description:string
Changes the description of the layer.
optional
bounds: [number
,number
,number
,number
]
Changes the bounds of the layer.
optional
style:object
The style of the layer.
Updates the source of the layer.
Only layers that have a GeoJSON source can have their source udpated.
For URL sources, if you pass the same URL again it will cause the data to be refreshed.
The value you need to pass to
optional
source: | |