创建地图元素
创建元素
POST /map/api/v1/workspaces/{workspace_id}/element-groups/{group_id}/elements
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
group_id | path | string | true | 元素组id |
workspace_id | path | string | true | 工作空间id |
x-auth-token | header | string | true | 访问令牌 |
body param | body | map.ElementCreateInput | true | body参数 |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | map.SwagUUIDResp |
Example responses
{
"code":0
"data":{
"id":"94c51c50-f111-45e8-ac8c-4f96c93ced44"
},
"message": "success"
}
Schemas
map.ElementCreateInput
{
"create_time": 1718075395953,
"description": "",
"element_id": "ff568a5e-d2d0-4306-89c1-233c4f3dc564",
"flag": "1",
"group_id": "e3dea0f5-37f2-4d79-ae58-490af3228060",
"id": "ff568a5e-d2d0-4306-89c1-233c4f3dc564",
"name": "D.11.11095594",
"obj_type": 0,
"oper_type": 0,
"resource": {
"content": {
"geometry": {
"coordinates": [
113.99759525641423,
22.595198811591644
],
"type": "Point"
},
"properties": {
"clampToGround": false,
"color": "#03FEF4"
},
"type": "Feature"
},
"type": 0,
"user_name": ""
},
"role": 0,
"update_time": 0,
"workspace_id": ""
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | 元素id |
name | string | true | none | 元素名称 |
resource | map.ResourceItem | true | none | 资源对象 |
create_time | Long | true | none | 时间戳:毫秒 |
group_id | String | true | none | 群组id |
obj_type | Int | false | none | 元素类型 0:默认、1:无人机、2:人类、3:遥控器、4:机巢、5:哨兵塔、6:雷视一体、7:雷达、8:PTZ、10:背景、11:动物、12:船、13:小车、15:骑行者、16:大车、35:烟雾、36:火、99:未检测到目标 |
oper_type | Int | false | none | 添加地图元素的操作类型,0:信息共享(默认),1:前去侦查,2:无人机前去侦查 |
role | Int | false | none | 元素形状:0:默认,1:菱形,2:矩形,3:梅花,4:正方形 |
map.ResourceItem
{
"content": {
"geometry": {
"coordinates": [
113.99759525641423,
22.595198811591644
],
"type": "Point"
},
"properties": {
"clampToGround": false,
"color": "#03FEF4"
},
"type": "Feature"
},
"type": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
content | map.Content | false | none | 资源内容对象 |
type | integer | false | none | 资源类型 * 0 - pin点 |
map.Content
{
"geometry": {
"coordinates": [
113.99759525641423,
22.595198811591644
],
"type": "Point"
},
"properties": {
"clampToGround": false,
"color": "#03FEF4"
},
"type": "Feature"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
geometry | object | false | none | geojson属性 |
» coordinates | [any] | false | none | geojson属性 |
» type | string | false | none | geojson属性 |
properties | object | false | none | geojson属性 |
» clampToGround | boolean | false | none | 是否贴地 |
» color | string | false | none | 支持的元素颜色<br> * BLUE:0x2D8CF0<br> * GREEN - 0x19BE6B<br><br> * YELLOW - 0xFFBB00<br><br> * ORANGE - 0xB620E0<br><br >* RED - 0xE23C39<br> * PURPLE - 0x212121 |
type | string | false | none | geojson属性 |
map.SwagUUIDResp
{
"code": 0,
"message": "success",
"data": {
"id": "107653f6-4032-4485-aa91-ed89454cceff"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
code | integer | true | none | 错误码 |
data | map.UUIDResp | true | none | none |
message | string | true | none | 错误描述 |
map.UUIDResp
{
"id": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | 元素id |