跳到主要内容

创建地图元素

创建元素

POST /map/api/v1/workspaces/{workspace_id}/element-groups/{group_id}/elements

Parameters

NameInTypeRequiredDescription
group_idpathstringtrue元素组id
workspace_idpathstringtrue工作空间id
x-auth-tokenheaderstringtrue访问令牌
body parambodymap.ElementCreateInputtruebody参数

Responses

StatusMeaningDescriptionSchema
200OKOKmap.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

NameTypeRequiredRestrictionsDescription
idstringtruenone元素id
namestringtruenone元素名称
resourcemap.ResourceItemtruenone资源对象
create_timeLongtruenone时间戳:毫秒
group_idStringtruenone群组id
obj_typeIntfalsenone元素类型 0:默认、1:无人机、2:人类、3:遥控器、4:机巢、5:哨兵塔、6:雷视一体、7:雷达、8:PTZ、10:背景、11:动物、12:船、13:小车、15:骑行者、16:大车、35:烟雾、36:火、99:未检测到目标
oper_typeIntfalsenone添加地图元素的操作类型,0:信息共享(默认),1:前去侦查,2:无人机前去侦查
roleIntfalsenone元素形状: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

NameTypeRequiredRestrictionsDescription
contentmap.Contentfalsenone资源内容对象
typeintegerfalsenone资源类型
* 0 - pin点

map.Content

{
"geometry": {
"coordinates": [
113.99759525641423,
22.595198811591644
],
"type": "Point"
},
"properties": {
"clampToGround": false,
"color": "#03FEF4"
},
"type": "Feature"
}

Properties

NameTypeRequiredRestrictionsDescription
geometryobjectfalsenonegeojson属性
» coordinates[any]falsenonegeojson属性
» typestringfalsenonegeojson属性
propertiesobjectfalsenonegeojson属性
» clampToGroundbooleanfalsenone是否贴地
» colorstringfalsenone支持的元素颜色<br>* BLUE:0x2D8CF0<br>* GREEN - 0x19BE6B<br><br>* YELLOW - 0xFFBB00<br><br>* ORANGE - 0xB620E0<br><br>* RED - 0xE23C39<br>* PURPLE - 0x212121
typestringfalsenonegeojson属性

map.SwagUUIDResp

{
"code": 0,
"message": "success",
"data": {
"id": "107653f6-4032-4485-aa91-ed89454cceff"
}
}

Properties

NameTypeRequiredRestrictionsDescription
codeintegertruenone错误码
datamap.UUIDResptruenonenone
messagestringtruenone错误描述

map.UUIDResp

{
"id": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenone元素id