Elements

List all elements on a map

Returns a GeoJSON FeatureCollection containing all the elements in a map that are not in an element group

GEThttps://felt.com/api/v2/maps/{map_id}/elements
Authorization
Path parameters
map_id*string

The ID of the map to list elements from.

Response

GeoJSON

Body
features*array of object
type*enum
FeatureCollection
Request
const response = await fetch('https://felt.com/api/v2/maps/{map_id}/elements', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "features": [
    {
      "geometry": {
        "felt:id": "OI22G7wJRzOo2p1RQeHIPB",
        "felt:parentId": "OI22G7wJRzOo2p1RQeHIPB"
      },
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}

List all elements in a group

Returns a GeoJSON FeatureCollection containing all the elements in a single group

GEThttps://felt.com/api/v2/maps/{map_id}/element_groups/{group_id}
Authorization
Path parameters
map_id*string

The ID of the map.

group_id*string

The ID of the element group.

Response

GeoJSON

Body
features*array of object
type*enum
FeatureCollection
Request
const response = await fetch('https://felt.com/api/v2/maps/{map_id}/element_groups/{group_id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "features": [
    {
      "geometry": {
        "felt:id": "OI22G7wJRzOo2p1RQeHIPB",
        "felt:parentId": "OI22G7wJRzOo2p1RQeHIPB"
      },
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}

List all element groups on a map

Returns a list of GeoJSON Feature Collections, one for each element group

GEThttps://felt.com/api/v2/maps/{map_id}/element_groups
Authorization
Path parameters
map_id*string

The ID of the map to list groups from.

Response

GroupList

Body
color*string

The color of the element group symbol.

elements*GeoJSON
id*string

The ID of the element group.

name*nullable string

The name of the element group.

symbol*nullable string

The symbol used to represent the element group.

Request
const response = await fetch('https://felt.com/api/v2/maps/{map_id}/element_groups', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "color": "text",
    "elements": {
      "features": [
        {
          "geometry": {
            "felt:id": "OI22G7wJRzOo2p1RQeHIPB",
            "felt:parentId": "OI22G7wJRzOo2p1RQeHIPB"
          },
          "type": "Feature"
        }
      ],
      "type": "FeatureCollection"
    },
    "id": "text",
    "name": "text",
    "symbol": "text"
  }
]

Create or update new elements

Each element is represented by a feature in the POSTed GeoJSON Feature Collection.

For each feature, including an existing element ID will result in the element being updated on the map. If no element ID is provided (or a non-existent one) , a new element will be created.

The maximum payload size for any POST to the Felt API is 1MB. Additionally, complex element geometry may be automatically simplified. If you require large, complex geometries, consider uploading your data as a Data Layer.

POSThttps://felt.com/api/v2/maps/{map_id}/elements
Authorization
Path parameters
map_id*string

The ID of the map to create the element in

Body
features*array of object
type*enum
FeatureCollection
Response

GeoJSON

Body
features*array of object
type*enum
FeatureCollection
Request
const response = await fetch('https://felt.com/api/v2/maps/{map_id}/elements', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "features": [
        {}
      ],
      "type": "FeatureCollection"
    }),
});
const data = await response.json();
Response
{
  "features": [
    {
      "geometry": {
        "felt:id": "OI22G7wJRzOo2p1RQeHIPB",
        "felt:parentId": "OI22G7wJRzOo2p1RQeHIPB"
      },
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}

Delete an element

Deletes the element with the ID specified in the path.

DELETEhttps://felt.com/api/v2/maps/{map_id}/elements/{element_id}
Authorization
Path parameters
map_id*string

The ID of the map to delete the element from.

element_id*string

The ID of the element to delete.

Response

No Content

Request
const response = await fetch('https://felt.com/api/v2/maps/{map_id}/elements/{element_id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "errors": [
    {
      "detail": "text",
      "source": {
        "header": "authorization"
      },
      "title": "text"
    }
  ]
}

Last updated