创建地图标注
POST
/openapi/v0.9/map/api/v1/workspaces/{proj_uuid}/element-groups/{group_id}/elements
es-geo-service
请求参数
Path 参数
proj_uuid
string
必需
group_id
string
元素组ID
示例值:
b4e57c98-b7d5-42b8-bfd1-59de199ea1c1
Header 参数
x-user-token
string
必需
默认值:
{{x-user-token}}
X-Request-Id
string
可选
默认值:
{% mock 'uuid' %}
Body 参数application/json
addIndex
boolean
可选
example: true
c2C
boolean
可选
example: false
desc
string
可选
example: "这是一个测试元素"
element_source
integer
可选
example: 1
id
string
可选
example: "800c9e11-828d-49d2-940f-d37372967e55"
name
string
可选
example: "测试元素"
resource
object
资源项
type
必需
source
integer
可选
example: 1
示例
{
"element_source": 1,
"resource": {
"type": 0,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": true
},
"geometry": {
"type": "Point",
"coordinates": [
123.78865442288412,
32.771765126525594,
0
]
}
}
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST '/openapi/v0.9/map/api/v1/workspaces//element-groups/b4e57c98-b7d5-42b8-bfd1-59de199ea1c1/elements' \
--header 'x-user-token;' \
--header 'X-Request-Id: {% mock '\''uuid'\'' %}' \
--header 'Content-Type: application/json' \
--data-raw '{
"element_source": 1,
"resource": {
"type": 0,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": true
},
"geometry": {
"type": "Point",
"coordinates": [
123.78865442288412,
32.771765126525594,
0
]
}
}
}
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
响应描述
data
object
必需
id
string
创建标注的ID
示例
{
"code": 0,
"message": "success",
"data": {
"id": "99585308-xxxxx-61ed0f68e033"
}
}
修改于 2025-06-25 08:25:42