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...
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.
"Circle"radius:
number
The radius of the circle in meters.
center:
LngLatTuple
The center of the circle.
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
optionalstrokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optionalstrokeWidth:number
The width of the element's stroke in pixels.
optionalstrokeStyle:"solid"|"dashed"|"dotted"
The style of the element's stroke.
optionalradiusMarker:boolean
Whether to show a marker on the circle that indicates the radius
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.
optionalradiusDisplayUnit: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.
optionalfillOpacity:number
The opacity of the circle's fill.
"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"12"solid"false90null0.25
optionalids:string[]
The ids of the element groups to get.
stringThe unique identifier for the element.
type:
"Circle"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
optionalstrokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optionalstrokeWidth:number
The width of the element's stroke in pixels.
optionalstrokeStyle:"solid"|"dashed"|"dotted"
The style of the element's stroke.
optionalradius:number
The radius of the circle in meters.
optionalradiusMarker:boolean
Whether to show a marker on the circle that indicates the radius
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.
optionalradiusDisplayUnit: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.
optionalfillOpacity:number
The opacity of the circle's fill.
optionalcenter:LngLatTuple
The center of the circle.
"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"12"solid"false90null0.25The parameters for the `onElementChange` and the `onElementCreate` listeners.
element:
null|
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 programmatically, this will be false.
ElementUpdate: | | | | | | | |
stringA 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.
You can use these ids to get the full element objects via the `getElements` method.
visible:
boolean
Whether the element group is visible or not.
shownInLegend:
boolean
Whether the element group is shown in the legend or not.
"Image"coordinates: [
number,number][][] =MultiLineStringGeometrySchema.shape.coordinates
imageUrl:
string
The URL of the image that is rendered in this element
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.
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.
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.
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.
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.
optionalopacity:number
The opacity of the image, between 0 and 1.
"default"1id:
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.
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.
stringThe 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.
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.
"Note"text:
string
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
optionalrotation:number
The rotation of the element in degrees.
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.
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.
optionalalign:"center"|"left"|"right"
The alignment of the text, either left, center or right.
optionalstyle:"light"|"italic"|"regular"|"caps"
The style of the text, either italic, light, regular or caps.
optionalwidthScale:number
optionalposition:LngLatTuple
The geographical position of the center of the note element.
If this is omitted, the note will be placed at the center of the current viewport.
stringThe 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.
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.
stringThe unique identifier for the element.
type:
"Highlighter"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalrenderHoles:boolean
Whether to render the holes of the highlighted area.
optionalopacity:number
The opacity of the highlighter, between 0 and 1.
optionalcoordinates:LngLatTuple[][][]
A multipolygon describing the area that is highlighted.
If renderHoles is set to false, only the outer ring of each polygon
will be rendered, filling in the area inside the highlighted region.
"Highlighter"coordinates:
LngLatTuple[][][]
A multipolygon describing the area that is highlighted.
If renderHoles is set to false, only the outer ring of each polygon
will be rendered, filling in the area inside the highlighted region.
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalrenderHoles:boolean
Whether to render the holes of the highlighted area.
optionalopacity:number
The opacity of the highlighter, between 0 and 1.
stringThe 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.
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.
"Place"coordinates:
LngLatTuple
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
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.
optionalframe:null|"frame-circle"|"frame-square"
The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.
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.
1"default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"01"center""regular""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"false0.5"default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"false0.5"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"false0.5"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"110"default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"falseid:
string
The unique identifier for the element.
type:
"Marker"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalopacity:number
The opacity of the marker, between 0 and 1.
optionalsize:number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
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.
optionalcoordinates: [][]
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.
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.
type:
"Path"
coordinates: [][]
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
optionalstrokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optionalstrokeWidth:number
The width of the element's stroke in pixels.
optionalstrokeStyle:"solid"|"dashed"|"dotted"
The style of the element's stroke.
optionaldistanceMarker:boolean
Whether a distance marker is shown at the midpoint of the path.
optionalroutingMode: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.
optionalendCaps: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.
type:
"Place"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
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.
optionalframe:null|"frame-circle"|"frame-square"
The frame that is rendered around the Place's symbol. This is only available for non-emoji symbols.
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.
optionalcoordinates:
id:
string
The unique identifier for the element.
type:
"Image"
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.
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.
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.
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.
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.
optionalcoordinates: [number,number][][] =MultiLineStringGeometrySchema.shape.coordinates
optionalimageUrl:string
The URL of the image that is rendered in this element
optionalopacity: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.
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:
"light"|"italic"|"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"
position:
The geographical position of the center of the text element.
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.
type:
"Text"
text:
string
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
optionalrotation:number
The rotation of the element in degrees.
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.
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.
optionalalign:"center"|"left"|"right"
The alignment of the text, either left, center or right.
optionalstyle:"light"|"italic"|"regular"|"caps"
The style of the text, either italic, light, regular or caps.
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.
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.
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.
id:
string
The unique identifier for the element.
type:
"Text"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
optionalrotation:number
The rotation of the element in degrees.
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.
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.
optionaltext:string
The text in the element.
optionalalign:"center"|"left"|"right"
The alignment of the text, either left, center or right.
optionalstyle:"light"|"italic"|"regular"|"caps"
The style of the text, either italic, light, regular or caps.
optionalposition:
The geographical position of the center of the text element.
stringThe unique identifier for the element.
type:
"Note"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
optionalrotation:number
The rotation of the element in degrees.
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.
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.
optionaltext:string
The text in the element.
optionalalign:"center"|"left"|"right"
The alignment of the text, either left, center or right.
optionalstyle:"light"|"italic"|"regular"|"caps"
The style of the text, either italic, light, regular or caps.
optionalwidthScale:number
optionalposition:LngLatTuple
The geographical position of the center of the note element.
stringThe 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.
coordinates:
LngLatTuple
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.
stringThe unique identifier for the element.
type:
"Polygon"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
optionalstrokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optionalstrokeWidth:number
The width of the element's stroke in pixels.
optionalstrokeStyle:"solid"|"dashed"|"dotted"
The style of the element's stroke.
optionalfillOpacity:number
The opacity of the polygon's fill, between 0 and 1.
optionalareaMarker:boolean
Whether to show an area marker on the polygon.
optionalcoordinates:LngLatTuple[][]
stringThe unique identifier for the element.
type:
"Path"
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
optionalstrokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optionalstrokeWidth:number
The width of the element's stroke in pixels.
optionalstrokeStyle:"solid"|"dashed"|"dotted"
The style of the element's stroke.
optionaldistanceMarker:boolean
Whether a distance marker is shown at the midpoint of the path.
optionalroutingMode: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.
optionalendCaps:boolean
Whether or not to show Start and End caps on the path. This is
only available if the routingMode is set.
optionalcoordinates:LngLatTuple[][]
"Polygon"coordinates:
LngLatTuple[][]
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalimageUrl:null|string
The URL of an image that has been added to the element.
optionalstrokeOpacity:number
A value between 0 and 1 that describes the opacity of the element's stroke.
optionalstrokeWidth:number
The width of the element's stroke in pixels.
optionalstrokeStyle:"solid"|"dashed"|"dotted"
The style of the element's stroke.
optionalfillOpacity:number
The opacity of the polygon's fill, between 0 and 1.
optionalareaMarker:boolean
Whether to show an area marker on the polygon.
"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"110"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"12"solid"falsenullfalse"default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"12"solid"falsenullfalse"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"false"default"1"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"01"center""regular""default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"01"center""regular""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"12"solid"0.25false"default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"01"center""regular""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"01"center""regular""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"false"default""#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"12"solid"0.25false"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"12"solid"falsenullfalse"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"12"solid"0.25falseid:
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:
"light"|"italic"|"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
position:
The geographical position of the center of the note element.
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.
"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"01"center""regular""default"type:
"Marker"
coordinates: [][]
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.
optionalcolor:string
The color of the element in some CSS-like format.
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.
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.
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.
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.
optionalopacity:number
The opacity of the marker, between 0 and 1.
optionalsize:number
The size of the marker, used in conjunction with the zoom to determine
the actual size of the marker.
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.
stringThe 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.
center:
LngLatTuple
The center of the circle.
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.
"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535""default"110"#ABC123";
"rgb(255, 0, 0)";
"hsl(200, 100%, 50%)";"#C93535"12"solid"false90null0.25"default"The Elements controller allows you to get information about the elements on the map, and make changes to their visibility.
getElement(
id:string):Promise<null| >
Get a single element from the map by its id.
Use this method when you know the specific ID of an element and want to retrieve its current state. This is more efficient than getting all elements and filtering.
Promise<null | >
A promise that resolves to the requested element, or null if not found.
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.
Promise<null | >
A promise that resolves to the element's geometry in GeoJSON format, or null if the element has no geometry.
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.
Promise<(null | )[]>
A promise that resolves to an array of elements, ordered by the order specified in Felt.
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.
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.
Promise<null | >
A promise that resolves to the requested element group, or null if not found.
getElementGroups(
constraint?: ):Promise<(null| )[]>
Gets element groups from the map, according to the filters supplied. If no constraints are supplied, all element groups will be returned in rendering order.
Use this method to retrieve multiple element groups, optionally filtered by constraints. This is useful for bulk operations on element groups.
Promise<(null | )[]>
A promise that resolves to an array of element groups in rendering order.
setElementGroupVisibility(
visibility: ):Promise<void>
Hide or show element groups with the given ids.
Use this method to control the visibility of multiple element groups at once. This is more efficient than hiding/showing individual elements.
Promise<void>
A promise that resolves when the visibility changes are applied.
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.
Promise<>
A promise that resolves to the created element.
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.
Promise<>
A promise that resolves to the updated element.
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.
Promise<void>
A promise that resolves when the element is deleted.
onElementCreate(
args: {handler: (change: ) =>void; }):VoidFunction
Adds a listener for when an element is created.
This will fire when elements are created programmatically, or when the user starts creating an element with a drawing tool.
When the user creates an element with a drawing tool, it can begin in an invalid state, such as if you've just placed a single point in a polygon.
You can use the isBeingCreated property to determine if the element is still being created by a drawing tool.
If you want to know when the element is finished being created, you can use the listener.
VoidFunction
A function to unsubscribe from the listener.
onElementCreateEnd(
args: {handler: (params: {element: ; }) =>void; }):VoidFunction
Listens for when a new element is finished being created by a drawing tool.
This differs from the listener, which fires whenever an element is first created. This fires when the user finishes creating an element which could be after a series of interactions.
For example, when creating a polygon, the user places a series of points then finishes by pressing Enter or Escape. Or when creating a Place element, they add the marker, type a label, then finally deselect the element.
VoidFunction
A function to unsubscribe from the listener.
onElementChange(
args: {options: {id:string; };handler: (change: ) =>void; }):VoidFunction
Adds a listener for when an element changes.
This will fire when an element is being edited, either on the map by the user or programmatically.
Like the listener, this will fire when an element is still being created by a drawing tool.
You can check the property to determine if the element is still being created by a drawing tool.
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.
Use this to react to element deletions, such as cleaning up related data or updating your application state.
VoidFunction
A function to unsubscribe from the listener.
onElementGroupChange(
args: {options: {id:string; };handler: (change: ) =>void; }):VoidFunction
Adds a listener for when an element group changes.
Use this to react to changes in element groups, such as when elements are added to or removed from groups.
VoidFunction
A function to unsubscribe from the listener.
Text, Note and Image elements do not return geometry, so will return null.
id
string
The id of the element you want to get.
id
string
The id of the element you want to get the geometry of.
constraint?
Optional constraints to apply to the elements returned from the map.
id
string
The id of the element group you want to get.
constraint?
Optional constraints to apply to the element groups returned from the map.
visibility
The visibility configuration for element groups.
element
The element configuration to create.
element
The element update configuration.
id
string
The id of the element to delete.
args
{ handler: (change: ) => void; }
-
args.handler
(change: ) => void
The handler that is called when an element is created. This will fire when elements are created programmatically, or when the user starts creating an element with a drawing tool. When the user creates an element with a drawing tool, it can begin in an invalid state, such as if you've just placed a single point in a polygon. You can use the isBeingCreated property to determine if the element is still being created by a drawing tool. If you want to know when the element is finished being created, you can use the listener.
args
{ handler: (params: { element: ; }) => void; }
-
args.handler
(params: { element: ; }) => void
The handler to call whenever this event fires.
args
{ options: { id: string; }; handler: (change: ) => void; }
-
args.options
{ id: string; }
-
args.options.id
string
The id of the element to listen for changes to.
args.handler
(change: ) => void
The handler that is called when the element changes.
args
{ options: { id: string; }; handler: () => void; }
-
args.options
{ id: string; }
-
args.options.id
string
The id of the element to listen for deletions of.
args.handler
() => void
The handler that is called when the element is deleted.
args
{ options: { id: string; }; handler: (change: ) => void; }
args.options
{ id: string; }
args.options.id
string
args.handler
(change: ) => void
const element = await felt.getElement("element-1");const geometry = await felt.getElementGeometry("element-1");
console.log(geometry?.type, geometry?.coordinates);const elements = await felt.getElements();const elementGroup = await felt.getElementGroup("element-group-1");const elementGroups = await felt.getElementGroups({ ids: ["element-group-1", "element-group-2"] });felt.setElementGroupVisibility({ show: ["element-group-1", "element-group-2"], hide: ["element-group-3"] });const element = await felt.createElement({ type: "Place", coordinates: [10, 10] });// Update a place element's coordinates
await felt.updateElement({
id: "element-1",
type: "Place",
coordinates: [10, 20]
});
// Update a polygon's style
await felt.updateElement({
id: "element-2",
type: "Polygon",
color: "#ABC123",
fillOpacity: 0.5
});await felt.deleteElement("element-1");const unsubscribe = felt.onElementCreate({
handler: ({isBeingCreated, element}) => console.log(element.id),
});
// later on...
unsubscribe();const unsubscribe = felt.onElementCreateEnd({
handler: (params) => console.log(params),
});
// later on...
unsubscribe();const unsubscribe = felt.onElementChange({
options: { id: "element-1" },
handler: ({element}) => console.log(element.id),
});
// later on...
unsubscribe();const unsubscribe = felt.onElementDelete({
options: { id: "element-1" },
handler: () => console.log("element-1 deleted"),
});
// later on...
unsubscribe();const unsubscribe = felt.onElementGroupChange({
options: { id: "element-group-1" },
handler: elementGroup => console.log(elementGroup.id),
});
// later on...
unsubscribe();