Elements

APIs for drawing spatially

Elements enable you to annotate maps with custom shapes, text, and markers.

With these APIs, you can create, update, and delete map elements.

List map elements

get

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

Authorizations
Path parameters
map_idstringRequired

The ID of the map to list elements from.

Responses
200

GeoJSON

application/json
get
GET /api/v2/maps/{map_id}/elements HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_API_KEY
Accept: */*
{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}

Create or update map elements

post

Create new elements or update existing ones on a map using GeoJSON data. Each element is represented by a feature in the POST'ed 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.

Authorizations
Path parameters
map_idstringRequired

The ID of the map to create the elements in

Body
typestring · enumRequiredPossible values:
Responses
200

GeoJSON

application/json
post
POST /api/v2/maps/{map_id}/elements HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 165

{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}
{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}

Delete map element

delete

Permanently delete an element from a map.

Authorizations
Path parameters
map_idstringRequired

The ID of the map to delete the element from.

element_idstringRequired

The ID of the element to delete.

Responses
204

No Content

No content

delete
DELETE /api/v2/maps/{map_id}/elements/{element_id} HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_API_KEY
Accept: */*

No content

Get map element group

get

Retrieve all elements from a specific group as GeoJSON.

Authorizations
Path parameters
map_idstringRequired

The ID of the map.

group_idstringRequired

The ID of the element group.

Responses
200

GeoJSON

application/json
get
GET /api/v2/maps/{map_id}/element_groups/{group_id} HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_API_KEY
Accept: */*
{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}

List map element groups

get

Returns a list of GeoJSON FeatureCollections, one for each element group in the map.

Authorizations
Path parameters
map_idstringRequired

The ID of the map to list groups from.

Responses
200

ElementGroupList

application/json
get
GET /api/v2/maps/{map_id}/element_groups HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_API_KEY
Accept: */*
[
  {
    "color": "text",
    "elements": {
      "features": [
        {
          "geometry": {
            "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
            "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
          },
          "properties": {},
          "type": "Feature"
        }
      ],
      "type": "FeatureCollection"
    },
    "id": "text",
    "name": "text",
    "symbol": "text"
  }
]

Create or update map element groups

post

Create new element groups or update existing ones.

For each Element Group, including an existing Element Group id will result in the Element Group being updated. If no id is provided, a new Element Group 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.

Authorizations
Path parameters
map_idstringRequired

The ID of the map to create the group in

Bodyobject · ElementGroupParams[]
colorstringOptionalDefault: #C93535
idstring · felt_idOptionalExample: luCHyMruTQ6ozGk3gPJfEB
namestringRequiredExample: My Element Group
symbolstringOptionalDefault: dot
Responses
200

Element group list

application/json
post
POST /api/v2/maps/{map_id}/element_groups HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 92

[
  {
    "color": "#C93535",
    "id": "luCHyMruTQ6ozGk3gPJfEB",
    "name": "My Element Group",
    "symbol": "dot"
  }
]
[
  {
    "color": "text",
    "elements": {
      "features": [
        {
          "geometry": {
            "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
            "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
          },
          "properties": {},
          "type": "Feature"
        }
      ],
      "type": "FeatureCollection"
    },
    "id": "text",
    "name": "text",
    "symbol": "text"
  }
]

Was this helpful?