Create Map Elements

2022-07-07
No Rating

Create Map 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 param

Responses

StatusMeaningDescriptionSchema
200OKopen in new windowOKmap.SwagUUIDResp

Example responses

{
	"code":0
   	"data":{
    	"id":"94c51c50-f111-45e8-ac8c-4f96c93ced44"
    },
    "message": "success"
}

Schemas

map.ElementCreateInput

{
  "id": "string",
  "name": "string",
  "resource": {
    "content": {
      "geometry": {
        "coordinates": [
          null
        ],
        "type": "string"
      },
      "properties": {
        "clampToGround": true,
        "color": "string"
      },
      "type": "string"
    },
    "type": 0
  }
}

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenoneelement id
namestringtruenoneelement name
resourcemap.ResourceItemtruenoneresource object

map.ResourceItem

{
  "content": {
    "geometry": {
      "coordinates": [
        null
      ],
      "type": "string"
    },
    "properties": {
      "clampToGround": true,
      "color": "string"
    },
    "type": "string"
  },
  "type": 0
}

Properties

NameTypeRequiredRestrictionsDescription
contentmap.Contentfalsenoneresource content object
typeintegerfalsenoneresource type
* 0 - pin point
* 1 - line
* 2 - polygon

map.Content

{
  "geometry": {
    "coordinates": [
      null
    ],
    "type": "string"
  },
  "properties": {
    "clampToGround": true,
    "color": "string"
  },
  "type": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
geometryobjectfalsenonegeojson attribute
» coordinates[any]falsenonegeojson attribute
» typestringfalsenonegeojson attribute
propertiesobjectfalsenonegeojson attribute
» clampToGroundbooleanfalsenonewhether it is on the ground
» colorstringfalsenonesupported colors
* BLUE:0x2D8CF0
* GREEN - 0x19BE6B

* YELLOW - 0xFFBB00

* ORANGE - 0xB620E0

* RED - 0xE23C39
* PURPLE - 0x212121
typestringfalsenonegeojson attribute

map.SwagUUIDResp

{
  "code": 0,
  "data": {
    "id": "string"
  },
  "message": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
codeintegertruenoneerror code
datamap.UUIDResptruenonenone
messagestringtruenoneerror description

map.UUIDResp

{
  "id": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenoneelement id