导入KML文件中的标注
POST
/openapi/v0.9/map/api/v1/workspaces/{proj_uuid}/element-groups/elements
es-geo-service
请求参数
Path 参数
proj_uuid
string
必需
Header 参数
x-user-token
string
必需
默认值:
{{x-user-token}}
X-Request-Id
string
可选
默认值:
{% mock 'uuid' %}
Body 参数application/json
element_groups
array [object {3}]
标注文件夹列表
>= 1 items
elements
array [object {5}]
标注列表
name
string
必需
example: "测试组"
p_index
integer
可选
example: 1
workspaceID
string
必 需
example: "ws-123456"
示例
{
"element_groups": [
{
"name": "xxx",
"p_index": -1,
"elements": [
{
"type": 1,
"name": "aaa",
"status": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"is3d": false
},
"geometry": {
"type": "LineString",
"coordinates": [
[
114.362652195628,
22.797118474136344,
90.50663103036271
],
[
114.36357319976744,
22.797151090038223,
74.73182277214048
]
]
}
}
},
{
"type": 0,
"name": "abc",
"status": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": false
},
"geometry": {
"type": "Point",
"coordinates": [
114.3625466082236,
22.79728163429665,
182.52560183429566
]
}
}
}
]
}
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/openapi/v0.9/map/api/v1/workspaces//element-groups/elements' \
--header 'x-user-token;' \
--header 'X-Request-Id: {% mock '\''uuid'\'' %}' \
--header 'Content-Type: application/json' \
--data-raw '{
"element_groups": [
{
"name": "xxx",
"p_index": -1,
"elements": [
{
"type": 1,
"name": "aaa",
"status": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"is3d": false
},
"geometry": {
"type": "LineString",
"coordinates": [
[
114.362652195628,
22.797118474136344,
90.50663103036271
],
[
114.36357319976744,
22.797151090038223,
74.73182277214048
]
]
}
}
},
{
"type": 0,
"name": "abc",
"status": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": false
},
"geometry": {
"type": "Point",
"coordinates": [
114.3625466082236,
22.79728163429665,
182.52560183429566
]
}
}
}
]
}
]
}'
返回响应
🟢200成功
application/json
Body
code
integer
响应码
message
string
响应消息
data
object
数据(空)
示例
{
"code": 0,
"message": "success",
"data": {}
}
修改于 2025-06-24 10:03:14