arrow-left

All pages
gitbookPowered by GitBook
1 of 38

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...

Elements


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

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

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

hashtag
Controller

hashtag
Interfaces

hashtag
Type Aliases

hashtag
Element Groups

hashtag
Elements

CircleElementCreate


hashtag
Properties

hashtag
type

CircleElementCreate
  • MarkerElementCreate

  • HighlighterElementCreate

  • TextElementCreate

  • NoteElementCreate

  • ImageElementCreate

  • PlaceElementRead

  • PathElementRead

  • PolygonElementRead

  • CircleElementRead

  • MarkerElementRead

  • HighlighterElementRead

  • TextElementRead

  • NoteElementRead

  • ImageElementRead

  • LinkElementRead

  • PlaceElementUpdate

  • PathElementUpdate

  • PolygonElementUpdate

  • CircleElementUpdate

  • MarkerElementUpdate

  • HighlighterElementUpdate

  • TextElementUpdate

  • NoteElementUpdate

  • ImageElementUpdate

  • ElementsController
    PlaceElementCreate
    PathElementCreate
    PolygonElementCreate
    ElementCreate
    ElementUpdate
    ElementGroup
    GetElementGroupsConstraint
    ElementGroupChangeCallbackParams
    GetElementsConstraint
    ElementChangeCallbackParams
    Element
    type: "Circle"

    hashtag
    radius

    radius: number

    The radius of the circle in meters.


    hashtag
    center

    center: LngLatTuple

    The center of the circle.


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    radiusMarker?

    optional radiusMarker: boolean

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

    hashtag
    Default


    hashtag
    radiusDisplayAngle?

    optional radiusDisplayAngle: number

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

    hashtag
    Default


    hashtag
    radiusDisplayUnit?

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

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

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

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

    The opacity of the circle's fill.

    hashtag
    Default

    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    90
    null
    0.25

    CircleElementUpdate


    hashtag
    Properties

    hashtag
    id

    GetElementGroupsConstraint


    The constraints to apply when getting element groups.

    hashtag
    Properties

    hashtag

    ids?

    optional ids: string[]

    The ids of the element groups to get.

    GetElementsConstraint


    The constraints to apply when getting elements.

    hashtag
    Properties

    hashtag
    ids?

    optional ids: string[]

    The ids of the elements to get.

    ElementCreate


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

    Element


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

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Circle"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    radius?

    optional radius: number

    The radius of the circle in meters.


    hashtag
    radiusMarker?

    optional radiusMarker: boolean

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

    hashtag
    Default


    hashtag
    radiusDisplayAngle?

    optional radiusDisplayAngle: number

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

    hashtag
    Default


    hashtag
    radiusDisplayUnit?

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

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

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

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

    The opacity of the circle's fill.

    hashtag
    Default


    hashtag
    center?

    optional center: LngLatTuple

    The center of the circle.

    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    90
    null
    0.25

    ElementChangeCallbackParams


    The parameters for the `onElementChange` and the `onElementCreate` listeners.

    hashtag
    Properties

    hashtag
    element

    element: null |

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


    hashtag
    isBeingCreated

    isBeingCreated: boolean

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

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

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

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

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

    ElementGroupChangeCallbackParams


    The parameters for the `onElementGroupChange` listener.

    hashtag
    Properties

    hashtag
    elementGroup

    elementGroup: null |

    ElementGroup


    hashtag
    Properties

    hashtag
    id

    ImageElementCreate


    hashtag
    Properties

    hashtag
    type

    ElementUpdate


    ElementUpdate: | | | | | | | |

    id: string

    A string identifying the element group.


    hashtag
    name

    name: string

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


    hashtag
    caption

    caption: null | string

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


    hashtag
    elementIds

    elementIds: string[]

    The ids of the elements in the element group.

    hashtag
    Remarks

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


    hashtag
    visible

    visible: boolean

    Whether the element group is visible or not.


    hashtag
    shownInLegend

    shownInLegend: boolean

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

    Element
    ElementGroup
    PlaceElementUpdate
    PathElementUpdate
    PolygonElementUpdate
    CircleElementUpdate
    MarkerElementUpdate
    HighlighterElementUpdate
    TextElementUpdate
    NoteElementUpdate
    ImageElementUpdate
    type: "Image"

    hashtag
    coordinates

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


    hashtag
    imageUrl

    imageUrl: string

    The URL of the image that is rendered in this element


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the image, between 0 and 1.

    hashtag
    Default

    "default"
    1

    ImageElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    type

    type: "Image"


    hashtag
    imageUrl

    imageUrl: string

    The URL of the image that is rendered in this element


    hashtag
    opacity

    opacity: number

    The opacity of the image, between 0 and 1.

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    LinkElementRead


    hashtag
    Properties

    hashtag
    id

    NoteElementCreate


    hashtag
    Properties

    hashtag
    type

    HighlighterElementRead


    hashtag
    Properties

    hashtag
    id

    HighlighterElementUpdate


    hashtag
    Properties

    hashtag
    id

    HighlighterElementCreate


    hashtag
    Properties

    hashtag
    type

    MarkerElementRead


    hashtag
    Properties

    hashtag
    id

    PlaceElementCreate


    hashtag
    Properties

    hashtag
    type

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    type

    type: "Link"


    hashtag
    url

    url: string

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    type: "Note"

    hashtag
    text

    text: string


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

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

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

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

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


    hashtag
    align?

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

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

    hashtag
    Default


    hashtag
    style?

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

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

    hashtag
    Default


    hashtag
    widthScale?

    optional widthScale: number


    hashtag
    position?

    optional position: LngLatTuple

    The geographical position of the center of the note element.

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

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    type

    type: "Highlighter"


    hashtag
    renderHoles

    renderHoles: boolean

    Whether to render the holes of the highlighted area.

    hashtag
    Default


    hashtag
    opacity

    opacity: number

    The opacity of the highlighter, between 0 and 1.

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Highlighter"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    renderHoles?

    optional renderHoles: boolean

    Whether to render the holes of the highlighted area.

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the highlighter, between 0 and 1.

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: LngLatTuple[][][]

    A multipolygon describing the area that is highlighted.

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

    type: "Highlighter"

    hashtag
    coordinates

    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.


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    renderHoles?

    optional renderHoles: boolean

    Whether to render the holes of the highlighted area.

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the highlighter, between 0 and 1.

    hashtag
    Default

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    type

    type: "Marker"


    hashtag
    opacity

    opacity: number

    The opacity of the marker, between 0 and 1.

    hashtag
    Default


    hashtag
    size

    size: number

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

    hashtag
    Default


    hashtag
    zoom

    zoom: number

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    type: "Place"

    hashtag
    coordinates

    coordinates: LngLatTuple


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    symbol?

    optional symbol: string

    The symbol that is rendered for the Place.

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

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


    hashtag
    frame?

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

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


    hashtag
    hideLabel?

    optional hideLabel: boolean

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

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

    hashtag
    Default

    1
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    false
    0.5
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false
    0.5
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false
    0.5
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    10
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false

    MarkerElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Marker"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the marker, between 0 and 1.

    hashtag
    Default


    hashtag
    size?

    optional size: number

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

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

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

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


    hashtag
    coordinates?

    optional coordinates: [][]

    PathElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    imageUrl

    imageUrl: null | string

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


    hashtag
    strokeOpacity

    strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth

    strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    type

    type: "Path"


    hashtag
    distanceMarker

    distanceMarker: boolean

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

    hashtag
    Default


    hashtag
    routingMode

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

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

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

    hashtag
    Default


    hashtag
    endCaps

    endCaps: boolean

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

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    PathElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Path"


    hashtag
    coordinates

    coordinates: [][]


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    distanceMarker?

    optional distanceMarker: boolean

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

    hashtag
    Default


    hashtag
    routingMode?

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

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

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

    hashtag
    Default


    hashtag
    endCaps?

    optional endCaps: boolean

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

    hashtag
    Default

    PlaceElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Place"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    symbol?

    optional symbol: string

    The symbol that is rendered for the Place.

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

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


    hashtag
    frame?

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

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


    hashtag
    hideLabel?

    optional hideLabel: boolean

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

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

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates:

    ImageElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Image"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    coordinates?

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


    hashtag
    imageUrl?

    optional imageUrl: string

    The URL of the image that is rendered in this element


    hashtag
    opacity?

    optional opacity: number

    The opacity of the image, between 0 and 1.

    hashtag
    Default

    TextElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    rotation

    rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale

    scale: number

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

    hashtag
    Default


    hashtag
    zoom

    zoom: number

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

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


    hashtag
    text

    text: string

    The text in the element.


    hashtag
    align

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

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

    hashtag
    Default


    hashtag
    style

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

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

    hashtag
    Default


    hashtag
    name

    name: string

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

    hashtag
    Remarks

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


    hashtag
    type

    type: "Text"


    hashtag
    position

    position:

    The geographical position of the center of the text element.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    TextElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Text"


    hashtag
    text

    text: string


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

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

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

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

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


    hashtag
    align?

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

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

    hashtag
    Default


    hashtag
    style?

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

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

    hashtag
    Default


    hashtag
    position?

    optional position:

    The geographical position of the center of the text element.

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

    PolygonElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    imageUrl

    imageUrl: null | string

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


    hashtag
    strokeOpacity

    strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth

    strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    type

    type: "Polygon"


    hashtag
    fillOpacity

    fillOpacity: number

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

    hashtag
    Default


    hashtag
    areaMarker

    areaMarker: boolean

    Whether to show an area marker on the polygon.

    hashtag
    Default


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    TextElementUpdate


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Text"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

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

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

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

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


    hashtag
    text?

    optional text: string

    The text in the element.


    hashtag
    align?

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

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

    hashtag
    Default


    hashtag
    style?

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

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

    hashtag
    Default


    hashtag
    position?

    optional position:

    The geographical position of the center of the text element.

    NoteElementUpdate


    hashtag
    Properties

    hashtag
    id

    PlaceElementRead


    hashtag
    Properties

    hashtag
    id

    PolygonElementUpdate


    hashtag
    Properties

    hashtag
    id

    PathElementUpdate


    hashtag
    Properties

    hashtag
    id

    PolygonElementCreate


    hashtag
    Properties

    hashtag
    type

    LngLatTuple
    LngLatTuple
    LngLatTuple
    LngLatTuple
    LngLatTuple
    LngLatTuple
    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Note"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    rotation?

    optional rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale?

    optional scale: number

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

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

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

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


    hashtag
    text?

    optional text: string

    The text in the element.


    hashtag
    align?

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

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

    hashtag
    Default


    hashtag
    style?

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

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

    hashtag
    Default


    hashtag
    widthScale?

    optional widthScale: number


    hashtag
    position?

    optional position: LngLatTuple

    The geographical position of the center of the note element.

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    imageUrl

    imageUrl: null | string

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


    hashtag
    type

    type: "Place"


    hashtag
    symbol

    symbol: string

    The symbol that is rendered for the Place.

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

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


    hashtag
    frame

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

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


    hashtag
    hideLabel

    hideLabel: boolean

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

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

    hashtag
    Default


    hashtag
    coordinates

    coordinates: LngLatTuple


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Polygon"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

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

    hashtag
    Default


    hashtag
    areaMarker?

    optional areaMarker: boolean

    Whether to show an area marker on the polygon.

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: LngLatTuple[][]

    id: string

    The unique identifier for the element.


    hashtag
    type

    type: "Path"


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    distanceMarker?

    optional distanceMarker: boolean

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

    hashtag
    Default


    hashtag
    routingMode?

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

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

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

    hashtag
    Default


    hashtag
    endCaps?

    optional endCaps: boolean

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

    hashtag
    Default


    hashtag
    coordinates?

    optional coordinates: LngLatTuple[][]

    type: "Polygon"

    hashtag
    coordinates

    coordinates: LngLatTuple[][]


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    imageUrl?

    optional imageUrl: null | string

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


    hashtag
    strokeOpacity?

    optional strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth?

    optional strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle?

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    fillOpacity?

    optional fillOpacity: number

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

    hashtag
    Default


    hashtag
    areaMarker?

    optional areaMarker: boolean

    Whether to show an area marker on the polygon.

    hashtag
    Default

    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    10
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    2
    "solid"
    false
    null
    false
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    null
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    false
    "default"
    1
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    0
    1
    "center"
    "regular"
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    2
    "solid"
    0.25
    false
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    0
    1
    "center"
    "regular"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    false
    "default"
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    0.25
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    false
    null
    false
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    2
    "solid"
    0.25
    false

    NoteElementRead


    hashtag
    Properties

    hashtag
    id

    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    rotation

    rotation: number

    The rotation of the element in degrees.

    hashtag
    Default


    hashtag
    scale

    scale: number

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

    hashtag
    Default


    hashtag
    zoom

    zoom: number

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

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


    hashtag
    text

    text: string

    The text in the element.


    hashtag
    align

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

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

    hashtag
    Default


    hashtag
    style

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

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

    hashtag
    Default


    hashtag
    name

    name: string

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

    hashtag
    Remarks

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


    hashtag
    type

    type: "Note"


    hashtag
    widthScale

    widthScale: number


    hashtag
    position

    position:

    The geographical position of the center of the note element.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    LngLatTuple
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    0
    1
    "center"
    "regular"
    "default"

    MarkerElementCreate


    hashtag
    Properties

    hashtag
    type

    type: "Marker"


    hashtag
    coordinates

    coordinates: [][]


    hashtag
    groupId?

    optional groupId: null | string

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


    hashtag
    color?

    optional color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name?

    optional name: null | string

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

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


    hashtag
    description?

    optional description: null | string

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

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


    hashtag
    attributes?

    optional attributes: Record<string, unknown>

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

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


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default


    hashtag
    opacity?

    optional opacity: number

    The opacity of the marker, between 0 and 1.

    hashtag
    Default


    hashtag
    size?

    optional size: number

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

    hashtag
    Default


    hashtag
    zoom?

    optional zoom: number

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

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

    CircleElementRead


    hashtag
    Properties

    hashtag
    id

    LngLatTuple
    id: string

    The unique identifier for the element.


    hashtag
    groupId

    groupId: null | string

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


    hashtag
    color

    color: string

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

    hashtag
    Example

    hashtag
    Default


    hashtag
    name

    name: null | string

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

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


    hashtag
    description

    description: null | string

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

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


    hashtag
    attributes

    attributes: Record<string, unknown>

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

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


    hashtag
    imageUrl

    imageUrl: null | string

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


    hashtag
    strokeOpacity

    strokeOpacity: number

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

    hashtag
    Default


    hashtag
    strokeWidth

    strokeWidth: number

    The width of the element's stroke in pixels.

    hashtag
    Default


    hashtag
    strokeStyle

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

    The style of the element's stroke.

    hashtag
    Default


    hashtag
    type

    type: "Circle"


    hashtag
    radius

    radius: number

    The radius of the circle in meters.


    hashtag
    radiusMarker

    radiusMarker: boolean

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

    hashtag
    Default


    hashtag
    radiusDisplayAngle

    radiusDisplayAngle: number

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

    hashtag
    Default


    hashtag
    radiusDisplayUnit

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

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

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

    hashtag
    Default


    hashtag
    fillOpacity

    fillOpacity: number

    The opacity of the circle's fill.

    hashtag
    Default


    hashtag
    center

    center: LngLatTuple

    The center of the circle.


    hashtag
    interaction?

    optional interaction: "default" | "locked"

    Whether the element is interactive.

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

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

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

    hashtag
    Default

    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    "default"
    1
    10
    "#ABC123";
    "rgb(255, 0, 0)";
    "hsl(200, 100%, 50%)";
    "#C93535"
    1
    2
    "solid"
    false
    90
    null
    0.25
    "default"

    ElementsController


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

    hashtag
    Extended by

    • FeltController

    hashtag
    Methods

    hashtag
    getElement()

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

    Get a single element from the map by its id.

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<null | >

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

    hashtag
    Example


    hashtag
    getElementGeometry()

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

    Get the geometry of an element in GeoJSON geometry format.

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

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

    • Path elements become MultiLineString geometries.

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

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<null | >

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

    hashtag
    Example


    hashtag
    getElements()

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

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

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<(null | )[]>

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

    hashtag
    Remarks

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

    hashtag
    Example


    hashtag
    getElementGroup()

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

    Get an element group from the map by its id.

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<null | >

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

    hashtag
    Example


    hashtag
    getElementGroups()

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

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

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<(null | )[]>

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

    hashtag
    Example


    hashtag
    setElementGroupVisibility()

    setElementGroupVisibility(visibility: ): Promise<void>

    Hide or show element groups with the given ids.

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<void>

    A promise that resolves when the visibility changes are applied.

    hashtag
    Example


    hashtag
    createElement()

    createElement(element: ): Promise<>

    Create a new element on the map.

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<>

    A promise that resolves to the created element.

    hashtag
    Example


    hashtag
    updateElement()

    updateElement(element: ): Promise<>

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

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<>

    A promise that resolves to the updated element.

    hashtag
    Example


    hashtag
    deleteElement()

    deleteElement(id: string): Promise<void>

    Delete an element from the map.

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    Promise<void>

    A promise that resolves when the element is deleted.

    hashtag
    Example

    hashtag
    Events

    hashtag
    onElementCreate()

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

    Adds a listener for when an element is created.

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

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

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

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementCreateEnd()

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

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

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

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementChange()

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

    Adds a listener for when an element changes.

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

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

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementDelete()

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

    Adds a listener for when an element is deleted.

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

    hashtag
    Parameters

    Parameter
    Type
    Description

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example


    hashtag
    onElementGroupChange()

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

    Adds a listener for when an element group changes.

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

    hashtag
    Parameters

    Parameter
    Type

    hashtag
    Returns

    VoidFunction

    A function to unsubscribe from the listener.

    hashtag
    Example

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

  • id

    string

    The id of the element you want to get.

    id

    string

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

    constraint?

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

    id

    string

    The id of the element group you want to get.

    constraint?

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

    visibility

    The visibility configuration for element groups.

    element

    The element configuration to create.

    element

    The element update configuration.

    id

    string

    The id of the element to delete.

    args

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

    -

    args.handler

    (change: ) => void

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

    args

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

    -

    args.handler

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

    The handler to call whenever this event fires.

    args

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

    -

    args.options

    { id: string; }

    -

    args.options.id

    string

    The id of the element to listen for changes to.

    args.handler

    (change: ) => void

    The handler that is called when the element changes.

    args

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

    -

    args.options

    { id: string; }

    -

    args.options.id

    string

    The id of the element to listen for deletions of.

    args.handler

    () => void

    The handler that is called when the element is deleted.

    args

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

    args.options

    { id: string; }

    args.options.id

    string

    args.handler

    (change: ) => void

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