创建地图元素

2024-12-20
暂无评分

创建元素

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
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": "text"
      },
      "properties": {
        "clampToGround": true,
        "color": "string"
      },
      "type": "text"
    },
    "type": 0
  }
}

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenone元素id
namestringtruenone元素名称
resourcemap.ResourceItemtruenone资源对象

map.ResourceItem

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

Properties

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

map.Content

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

Properties

NameTypeRequiredRestrictionsDescription
geometryobjectfalsenonegeojson属性
» coordinates[any]falsenonegeojson属性
» typestringfalsenonegeojson属性
propertiesobjectfalsenonegeojson属性
» clampToGroundbooleanfalsenone是否贴地
» is3dbooleanfalsenone是否为空间线面
» colorstringfalsenone支持的元素颜色
* BLUE:0x2D8CF0
* GREEN - 0x19BE6B

* YELLOW - 0xFFBB00

* ORANGE - 0xB620E0

* RED - 0xE23C39
* PURPLE - 0x212121
typestringfalsenonegeojson属性

map.SwagUUIDResp

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

Properties

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

map.UUIDResp

{
  "id": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenone元素id
若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。