The new data for the element or null if the element was removed.
isBeingCreated
isBeingCreated: boolean
Whether or not this element is still being created by a drawing tool.
For example, if the user begins drawing a polygon, they need to place multiple points until they've ultimately completed the polygon. All the time they are still placing points, this will be true.
For elements that require text entry (such as Places, Text and Notes) this will be true all the time the user is typing text until the point at which the user finishes, by pressing Escape for example.
If the user is editing an existing element, this will be false.
For elements that are created programmatically, this will be false.
HighlighterElementCreate
Properties
type
GetElementGroupsConstraint
The constraints to apply when getting element groups.
A multipolygon describing the area that is highlighted.
If renderHoles is set to false, only the outer ring of each polygon
will be rendered, filling in the area inside the highlighted region.
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
renderHoles?
optionalrenderHoles: boolean
Whether to render the holes of the highlighted area.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity
strokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Default
strokeWidth
strokeWidth: number
The width of the element's stroke in pixels.
Default
strokeStyle
strokeStyle: "solid" | "dashed" | "dotted"
The style of the element's stroke.
Default
type
type: "Circle"
radius
radius: number
The radius of the circle in meters.
radiusMarker
radiusMarker: boolean
Whether to show a marker on the circle that indicates the radius
Default
radiusDisplayAngle
radiusDisplayAngle: number
The angle at which the control point for setting the radius is displayed,
in degrees. When the radiusMarker is true, there is a dotted line rendered
from the center of the circle to the control point, and the marker is shown
at the midpoint of this line.
The unit of the radius used when the radiusMarker is true.
A value of null means that the unit matches the user's locale.
Default
fillOpacity
fillOpacity: number
The opacity of the circle's fill.
Default
center
center:
The center of the circle.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
NoteElementCreate
Properties
type
type: "Note"
text
text: string
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: number
The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.
Default
zoom?
optionalzoom: number
The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
The style of the text, either italic, light, regular or caps.
Default
widthScale?
optionalwidthScale: number
position?
optionalposition:
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.
CircleElementCreate
Properties
type
type: "Circle"
radius
radius: number
The radius of the circle in meters.
center
center:
The center of the circle.
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Whether to show a marker on the circle that indicates the radius
Default
radiusDisplayAngle?
optionalradiusDisplayAngle: number
The angle at which the control point for setting the radius is displayed,
in degrees. When the radiusMarker is true, there is a dotted line rendered
from the center of the circle to the control point, and the marker is shown
at the midpoint of this line.
The unit of the radius used when the radiusMarker is true.
A value of null means that the unit matches the user's locale.
Default
fillOpacity?
optionalfillOpacity: number
The opacity of the circle's fill.
Default
ImageElementRead
Properties
id
id: string
The unique identifier for the element.
groupId
groupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
type
type: "Image"
imageUrl
imageUrl: string
The URL of the image that is rendered in this element
opacity
opacity: number
The opacity of the image, between 0 and 1.
Default
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
The URL of the image that is rendered in this element
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
The Felt SDK lets you read, create and update elements on the map.
Elements that are created via the SDK are only available to the current
session - they are not persisted to the map and not available to other users
of the map.
If you want to let your users create elements (as opposed to using the SDK to
create them programmatically), you can use the ToolsController to
select and configure the drawing tools in Felt.
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
description
description: null | string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
rotation
rotation: number
The rotation of the element in degrees.
Default
scale
scale: number
The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.
Default
zoom
zoom: number
The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.
text
text: string
The text in the element.
align
align: "center" | "left" | "right"
The alignment of the text, either left, center or right.
Default
style
style: "light" | "italic" | "regular" | "caps"
The style of the text, either italic, light, regular or caps.
Default
name
name: string
The text shown in the element, which is identical to the text property.
Remarks
This is added for consistency with other elements that have a name property.
The geographical position of the center of the note element.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
Default
id: string
The unique identifier for the element.
type
type: "Place"
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
symbol?
optionalsymbol: string
The symbol that is rendered for the Place.
This can be an emoji by using colon-enclosed characters (e.g. ":smiley:")
or one of the symbols available in Felt's symbol library.
You can see the available symbols in the Felt UI when editing a Place
by hovering a symbol and converting the tooltip to kebab-case. For example,
the "Oil barrel" symbol is oil-barrel.
The frame that is rendered around the Place's symbol. This is
only available for non-emoji symbols.
hideLabel?
optionalhideLabel: boolean
Whether the element's label is hidden on the map. This allows you
to add a name to the element and can show in popups, but not have
it visible on the map.
This will also hide the faint placeholder label that is shown when
an editable Place is selected.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Whether to show a marker on the circle that indicates the radius
Default
radiusDisplayAngle?
optionalradiusDisplayAngle: number
The angle at which the control point for setting the radius is displayed,
in degrees. When the radiusMarker is true, there is a dotted line rendered
from the center of the circle to the control point, and the marker is shown
at the midpoint of this line.
The unit of the radius used when the radiusMarker is true.
A value of null means that the unit matches the user's locale.
Default
fillOpacity?
optionalfillOpacity: number
The opacity of the circle's fill.
Default
center?
optionalcenter:
The center of the circle.
TextElementCreate
Properties
type
type: "Text"
text
text: string
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: number
The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.
Default
zoom?
optionalzoom: number
The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
The style of the text, either italic, light, regular or caps.
Default
position?
optionalposition:
The geographical position of the center of the text element.
If this is omitted, the text will be placed at the center of the current viewport.
PlaceElementCreate
Properties
type
type: "Place"
coordinates
coordinates:
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
symbol?
optionalsymbol: string
The symbol that is rendered for the Place.
This can be an emoji by using colon-enclosed characters (e.g. ":smiley:")
or one of the symbols available in Felt's symbol library.
You can see the available symbols in the Felt UI when editing a Place
by hovering a symbol and converting the tooltip to kebab-case. For example,
the "Oil barrel" symbol is oil-barrel.
The frame that is rendered around the Place's symbol. This is
only available for non-emoji symbols.
hideLabel?
optionalhideLabel: boolean
Whether the element's label is hidden on the map. This allows you
to add a name to the element and can show in popups, but not have
it visible on the map.
This will also hide the faint placeholder label that is shown when
an editable Place is selected.
Default
PolygonElementRead
Properties
id
id: string
The unique identifier for the element.
groupId
groupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity
strokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Default
strokeWidth
strokeWidth: number
The width of the element's stroke in pixels.
Default
strokeStyle
strokeStyle: "solid" | "dashed" | "dotted"
The style of the element's stroke.
Default
type
type: "Polygon"
fillOpacity
fillOpacity: number
The opacity of the polygon's fill, between 0 and 1.
Default
areaMarker
areaMarker: boolean
Whether to show an area marker on the polygon.
Default
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
MarkerElementUpdate
Properties
id
id: string
The unique identifier for the element.
type
type: "Marker"
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
opacity?
optionalopacity: number
The opacity of the marker, between 0 and 1.
Default
size?
optionalsize: number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
Default
zoom?
optionalzoom: number
The zoom level at which the marker was created. This is combined with
the size to determine the actual size of the marker.
When creating a marker, if you don't supply this value it defaults to
the current zoom of the map when you call createElement.
coordinates?
optionalcoordinates: [][]
MarkerElementCreate
Properties
type
type: "Marker"
coordinates
coordinates: [][]
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
opacity?
optionalopacity: number
The opacity of the marker, between 0 and 1.
Default
size?
optionalsize: number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
Default
zoom?
optionalzoom: number
The zoom level at which the marker was created. This is combined with
the size to determine the actual size of the marker.
When creating a marker, if you don't supply this value it defaults to
the current zoom of the map when you call createElement.
ElementGroup
Properties
id
id: string
A string identifying the element group.
name
name: string
The name of the element group. This is shown in the legend.
caption
caption: null | string
The caption of the element group. This is shown in the legend.
elementIds
elementIds: string[]
The ids of the elements in the element group.
Remarks
You can use these ids to get the full element objects via the method.
visible
visible: boolean
Whether the element group is visible or not.
shownInLegend
shownInLegend: boolean
Whether the element group is shown in the legend or not.
ImageElementUpdate
Properties
id
id: string
The unique identifier for the element.
type
type: "Image"
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: number
The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.
Default
zoom?
optionalzoom: number
The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.
text?
optionaltext: string
The text in the element.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
The geographical position of the center of the note element.
id: string
The unique identifier for the element.
groupId
groupId: null | string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
description
description: null | string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
rotation
rotation: number
The rotation of the element in degrees.
Default
scale
scale: number
The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.
Default
zoom
zoom: number
The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.
text
text: string
The text in the element.
align
align: "center" | "left" | "right"
The alignment of the text, either left, center or right.
Default
style
style: "light" | "italic" | "regular" | "caps"
The style of the text, either italic, light, regular or caps.
Default
name
name: string
The text shown in the element, which is identical to the text property.
Remarks
This is added for consistency with other elements that have a name property.
The geographical position of the center of the text element.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
Default
id: string
The unique identifier for the element.
type
type: "Highlighter"
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
renderHoles?
optionalrenderHoles: boolean
Whether to render the holes of the highlighted area.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
The opacity of the polygon's fill, between 0 and 1.
Default
areaMarker?
optionalareaMarker: boolean
Whether to show an area marker on the polygon.
Default
id: string
The unique identifier for the element.
groupId
groupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
type
type: "Place"
symbol
symbol: string
The symbol that is rendered for the Place.
This can be an emoji by using colon-enclosed characters (e.g. ":smiley:")
or one of the symbols available in Felt's symbol library.
You can see the available symbols in the Felt UI when editing a Place
by hovering a symbol and converting the tooltip to kebab-case. For example,
the "Oil barrel" symbol is oil-barrel.
frame
frame: null | "frame-circle" | "frame-square"
The frame that is rendered around the Place's symbol. This is
only available for non-emoji symbols.
hideLabel
hideLabel: boolean
Whether the element's label is hidden on the map. This allows you
to add a name to the element and can show in popups, but not have
it visible on the map.
This will also hide the faint placeholder label that is shown when
an editable Place is selected.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
type
type: "Marker"
opacity
opacity: number
The opacity of the marker, between 0 and 1.
Default
size
size: number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
Default
zoom
zoom: number
The zoom level at which the marker was created. This is combined with
the size to determine the actual size of the marker.
When creating a marker, if you don't supply this value it defaults to
the current zoom of the map when you call createElement.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
LinkElementRead
Properties
id
id: string
The unique identifier for the element.
groupId
groupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
type
type: "Link"
url
url: string
The URL of the link that is rendered in this element.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
HighlighterElementRead
Properties
id
id: string
The unique identifier for the element.
groupId
groupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
type
type: "Highlighter"
renderHoles
renderHoles: boolean
Whether to render the holes of the highlighted area.
Default
opacity
opacity: number
The opacity of the highlighter, between 0 and 1.
Default
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
TextElementUpdate
Properties
id
PathElementCreate
Properties
type
PolygonElementUpdate
Properties
id
PathElementRead
Properties
id
id: string
The unique identifier for the element.
type
type: "Text"
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to. For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it is selected.
Note that some elements are not selectable on the map, such as Notes, Text and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not part of the element's core data, such as a Place's address or some other data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user, which is often used for elements that you don't want the user to edit or move by accident.
Elements that were created by the map author (i.e. not during an SDK "session") are not editable and have special behaviour depending on their name, description and attributes.
Default
rotation?
optionalrotation: number
The rotation of the element in degrees.
Default
scale?
optionalscale: number
The relative scale of the element from the default size. This is combined with the zoom to determine the actual size of the element.
Default
zoom?
optionalzoom: number
The zoom level at which the element was created. This is combined with the scale to determine the actual size of the element.
When creating an element, if you don't supply this value it defaults to the current zoom of the map when you call createElement.
text?
optionaltext: string
The text in the element.
align?
optionalalign: "center" | "left" | "right"
The alignment of the text, either left, center or right.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Whether this represents a route, and if so, what mode of transport
is used.
If this is null, the path is not considered to be a route, so while it
can have a distanceMarker, it will does not have a start or end cap.
Default
endCaps?
optionalendCaps: boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode is set.
Default
id: string
The unique identifier for the element.
type
type: "Polygon"
groupId?
optionalgroupId: null | string
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color?
optionalcolor: string
The color of the element in some CSS-like format.
Example
Default
name?
optionalname: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description?
optionaldescription: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes?
optionalattributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Default
imageUrl?
optionalimageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity?
optionalstrokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
The ID of the element group that the element belongs to.
For elements that are not part of a group, this will be null.
color
color: string
The color of the element in some CSS-like format.
Example
Default
name
name: null | string
The element's name. For elements that can show a label or text on
the map (e.g. a Place or Text element) this is the text that will be shown.
For elements such as Polygons or Paths, the name is what is shown when
the element is selected by clicking on it.
description
description: null | string
Text describing the element, which is shown in an element's popup when it
is selected.
Note that some elements are not selectable on the map, such as Notes, Text
and Markers, so their description will not be shown.
attributes
attributes: Record<string, unknown>
A set of key-value pairs that can be used to store arbitrary data about the element.
This is most useful for associating additional data with an element that is not
part of the element's core data, such as a Place's address or some other
data.
imageUrl
imageUrl: null | string
The URL of an image that has been added to the element.
strokeOpacity
strokeOpacity: number
A value between 0 and 1 that describes the opacity of the element's stroke.
Default
strokeWidth
strokeWidth: number
The width of the element's stroke in pixels.
Default
strokeStyle
strokeStyle: "solid" | "dashed" | "dotted"
The style of the element's stroke.
Default
type
type: "Path"
distanceMarker
distanceMarker: boolean
Whether a distance marker is shown at the midpoint of the path.
Whether this represents a route, and if so, what mode of transport
is used.
If this is null, the path is not considered to be a route, so while it
can have a distanceMarker, it will does not have a start or end cap.
Default
endCaps
endCaps: boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode is set.
Default
interaction?
optionalinteraction: "default" | "locked"
Whether the element is interactive.
The default interaction mode means that the element can be selected and edited by
the user, if it was created by the SDK or by the user using a tool.
If the interaction mode is locked, the element will not be editable by the user,
which is often used for elements that you don't want the user to edit or move by
accident.
Elements that were created by the map author (i.e. not during an SDK "session") are
not editable and have special behaviour depending on their name, description and
attributes.
Use this method when you know the specific ID of an element and want to retrieve its current state. This is more efficient than getting all elements and filtering.
Parameters
Parameter
Type
Description
Returns
Promise<null | >
A promise that resolves to the requested element, or null if not found.
Example
getElementGeometry()
getElementGeometry(id: string): Promise<null | >
Get the geometry of an element in GeoJSON geometry format.
For most element types, the geometry returned is based on the coordinates property of the element, with some differences:
For Circle elements, the geometry is a Polygon drawn from the center and radius properties.
Path elements become MultiLineString geometries.
Marker elements return a MultiLineString of the path traced by the user as they drew the marker. Note that this is not the polygon formed by filled-in "pen" stroke, which doesn't exactly follow the path traced by the user as it is smoothed and interpolated to create a continuous line.
Use this method when you need the geometric representation of an element for spatial analysis or visualization purposes.
Parameters
Parameter
Type
Description
Returns
Promise<null | >
A promise that resolves to the element's geometry in GeoJSON format, or null if the element has no geometry.
Example
getElements()
getElements(constraint?: ): Promise<(null | )[]>
Gets elements from the map, according to the constraints supplied. If no constraints are supplied, all elements will be returned.
Use this method to retrieve multiple elements, optionally filtered by constraints. This is useful for bulk operations or when you need to analyze all elements on the map.
Parameters
Parameter
Type
Description
Returns
Promise<(null | )[]>
A promise that resolves to an array of elements, ordered by the order specified in Felt.
Remarks
The elements in the map, ordered by the order specified in Felt. This is not necessarily the order that they are drawn in, as Felt draws points above lines and lines above polygons, for instance.
Example
getElementGroup()
getElementGroup(id: string): Promise<null | >
Get an element group from the map by its id.
Element groups allow you to organize related elements together and control their visibility as a unit.
Parameters
Parameter
Type
Description
Returns
Promise<null | >
A promise that resolves to the requested element group, or null if not found.
Gets element groups from the map, according to the filters supplied. If no constraints are supplied, all element groups will be returned in rendering order.
Use this method to retrieve multiple element groups, optionally filtered by constraints. This is useful for bulk operations on element groups.
Parameters
Parameter
Type
Description
Returns
Promise<(null | )[]>
A promise that resolves to an array of element groups in rendering order.
Use this method to control the visibility of multiple element groups at once. This is more efficient than hiding/showing individual elements.
Parameters
Parameter
Type
Description
Returns
Promise<void>
A promise that resolves when the visibility changes are applied.
Example
createElement()
createElement(element: ): Promise<>
Create a new element on the map.
Use this method to programmatically create elements on the map. Elements created via the SDK are only available to the current session and are not persisted.
Parameters
Parameter
Type
Description
Returns
Promise<>
A promise that resolves to the created element.
Example
updateElement()
updateElement(element: ): Promise<>
Update an element on the map. The element type must be specified.
Use this method to modify existing elements. You can update properties like coordinates, styling, and metadata.
Parameters
Parameter
Type
Description
Returns
Promise<>
A promise that resolves to the updated element.
Example
deleteElement()
deleteElement(id: string): Promise<void>
Delete an element from the map.
Use this method to remove elements from the map. This operation cannot be undone.
Parameters
Parameter
Type
Description
Returns
Promise<void>
A promise that resolves when the element is deleted.
Listens for when a new element is finished being created by a drawing tool.
This differs from the listener, which fires whenever an element is first created. This fires when the user finishes creating an element which could be after a series of interactions.
For example, when creating a polygon, the user places a series of points then finishes by pressing Enter or Escape. Or when creating a Place element, they add the marker, type a label, then finally deselect the element.
Adds a listener for when an element group changes.
Use this to react to changes in element groups, such as when elements are added to or removed from groups.
Parameters
Parameter
Type
Returns
VoidFunction
A function to unsubscribe from the listener.
Example
Text, Note and Image elements do not return geometry, so will return null.
id
string
The id of the element you want to get.
id
string
The id of the element you want to get the geometry of.
constraint?
Optional constraints to apply to the elements returned from the map.
id
string
The id of the element group you want to get.
constraint?
Optional constraints to apply to the element groups returned from the map.
visibility
The visibility configuration for element groups.
element
The element configuration to create.
element
The element update configuration.
id
string
The id of the element to delete.
args
{ handler: (change: ) => void; }
-
args.handler
(change: ) => void
The handler that is called when an element is created. This will fire when elements are created programmatically, or when the user starts creating an element with a drawing tool. When the user creates an element with a drawing tool, it can begin in an invalid state, such as if you've just placed a single point in a polygon. You can use the isBeingCreated property to determine if the element is still being created by a drawing tool. If you want to know when the element is finished being created, you can use the listener.