// pin点
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 0,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": true
},
"geometry": {
"type": "Point",
"coordinates": [
108.42625652534299,
30.59263023356542,
0
]
}
}
}
}
//线
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
110.78912343493995,
28.7786761289101
],
[
110.78980969315512,
28.777435625158603
]
]
}
}
}
}
//多边形
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 2,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
110.79093322779515,
28.78036215346328
],
[
110.7908800891774,
28.777869391788467
],
[
110.7942962561357,
28.7796971945124
]
]
]
}
}
}
}
curl --location -g --request POST '/map/api/v1.0/projects/{{project_uuid}}/elements' \
--header 'X-Organization-Key: {{orgnazation_key}}' \
--header 'X-Organization-Key;' \
--header 'Content-Type: application/json' \
--data-raw '// pin点
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 0,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0",
"clampToGround": true
},
"geometry": {
"type": "Point",
"coordinates": [
108.42625652534299,
30.59263023356542,
0
]
}
}
}
}
//线
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 1,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
110.78912343493995,
28.7786761289101
],
[
110.78980969315512,
28.777435625158603
]
]
}
}
}
}
//多边形
{
"name": "元素名称",
"desc": "描述",
"resource": {
"type": 2,
"content": {
"type": "Feature",
"properties": {
"color": "#2D8CF0"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
110.79093322779515,
28.78036215346328
],
[
110.7908800891774,
28.777869391788467
],
[
110.7942962561357,
28.7796971945124
]
]
]
}
}
}
}'
{
"code": 0,
"message": "success",
"data": {
"id": "cdb6f644-8925-463d-8977-564e866d7e86"
}
}