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.
Returns a GeoJSON FeatureCollection
containing all the elements in a map that are not in an element group.
The ID of the map to list elements from.
GeoJSON
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
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 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 ID of the map to create the elements in
GeoJSON
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
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"
}
Permanently delete an element from a map.
This action cannot be undone. The element will be permanently removed from the map.
The ID of the map to delete the element from.
The ID of the element to delete.
No Content
No content
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
DELETE /api/v2/maps/{map_id}/elements/{element_id} HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_API_KEY
Accept: */*
No content
Retrieve all elements from a specific group as GeoJSON.
The ID of the map.
The ID of the element group.
GeoJSON
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
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"
}
Returns a list of GeoJSON FeatureCollection
s, one for each element group in the map.
The ID of the map to list groups from.
ElementGroupList
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
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 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 ID of the map to create the group in
#C93535
luCHyMruTQ6ozGk3gPJfEB
My Element Group
dot
Element group list
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
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?