Push Event Notification and Map Annotation
POST
/map/api/v1.0/projects/{project_uuid}/elements
Request
Path Params
project_uuid
string
required
Example:
{{project_uuid}}
Header Params
X-Organization-Key
string
required
Example:
{{orgnazation_key}}
Body Params application/json
element_source
integer
required
name
string
required
desc
string
required
resource
object
required
type
integer
required
content
object
required
Example
// pin点
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 0,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": true
},
"geometry": {
"type": "Point",
"coordinates": [
108.42625652534299,
30.59263023356542,
0
]
}
}
}
}
//线
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
110.78912343493995,
28.7786761289101
],
[
110.78980969315512,
28.777435625158603
]
]
}
}
}
}
//多边形
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 2,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
110.79093322779515,
28.78036215346328
],
[
110.7908800891774,
28.777869391788467
],
[
110.7942962561357,
28.7796971945124
]
]
]
}
}
}
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/map/api/v1.0/projects/{{project_uuid}}/elements' \
--header 'X-Organization-Key: {{orgnazation_key}}' \
--header 'X-Organization-Key;' \
--header 'Content-Type: application/json' \
--data-raw '// pin点
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 0,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": true
},
"geometry": {
"type": "Point",
"coordinates": [
108.42625652534299,
30.59263023356542,
0
]
}
}
}
}
//线
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
110.78912343493995,
28.7786761289101
],
[
110.78980969315512,
28.777435625158603
]
]
}
}
}
}
//多边形
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 2,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
110.79093322779515,
28.78036215346328
],
[
110.7908800891774,
28.777869391788467
],
[
110.7942962561357,
28.7796971945124
]
]
]
}
}
}
}'
Responses
🟢200成功
application/json
Body
code
integer
required
message
string
required
data
object
required
id
string
required
Example
{
"code": 0,
"message": "success",
"data": {
"id": "cdb6f644-8925-463d-8977-564e866d7e86"
}
}
🟠401未授权