跳到主要内容

Create Map Elements

Create Elements

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

Parameters

NameInTypeRequiredDescription
group_idpathstringtrueElement group ID
workspace_idpathstringtrueWorkspace ID
x-auth-tokenheaderstringtrueAccess token
body parambodymap.ElementCreateInputtrueBody parameters

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
idstringtruenoneElement ID
namestringtruenoneElement name
resourcemap.ResourceItemtruenoneResource object
create_timeLongtruenoneTimestamp in milliseconds
group_idStringtruenoneGroup ID
obj_typeIntfalsenoneElement type: 0: Default, 1: UAV, 2: Human, 3: Remote Control, 4: Drone Nest, 5: Sentry Tower, 6: Radar Camera, 7: Radar, 8: PTZ, 10: Background, 11: Animal, 12: Boat, 13: Small Car, 15: Cyclist, 16: Large Car, 35: Smoke, 36: Fire, 99: Undetected Target
oper_typeIntfalsenoneMap element operation type: 0: Information Sharing (Default), 1: Reconnaissance, 2: UAV Reconnaissance
roleIntfalsenoneElement shape: 0: Default, 1: Diamond, 2: Rectangle, 3: Plum Blossom, 4: Square

map.ResourceItem

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

Properties

NameTypeRequiredRestrictionsDescription
contentmap.ContentfalsenoneResource content object
typeintegerfalsenoneResource type
* 0 - pin点

map.Content

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

Properties

NameTypeRequiredRestrictionsDescription
geometryobjectfalsenoneGeoJSON properties
» coordinates[any]falsenoneGeoJSON coordinates
» typestringfalsenoneGeoJSON type
propertiesobjectfalsenoneGeoJSON properties
» clampToGroundbooleanfalsenoneClamp to ground
» colorstringfalsenoneSupported element colors:
* BLUE: 0x2D8CF0
* GREEN: 0x19BE6B
* YELLOW: 0xFFBB00
* ORANGE: 0xB620E0
* RED: 0xE23C39
* PURPLE: 0x212121
typestringfalsenoneGeoJSON type

map.SwagUUIDResp

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

Properties

NameTypeRequiredRestrictionsDescription
codeintegertruenoneError code
datamap.UUIDResptruenonenone
messagestringtruenoneError description

map.UUIDResp

{
"id": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenoneElement ID