เรียก geojson ตามชั้น
ใช้ API ต่อไปนี้เพื่อเรียกดูไฟล์ GeoJSON ของชั้นที่ระบุในโปรเจกต์หนึ่ง
ใช้ API ต่อไปนี้เพื่อเรียกดูไฟล์ GeoJSON ของชั้นที่ระบุในโปรเจกต์หนึ่ง
📍 GET /open-api/v1/map/floor/{id}
ส่วนหัวของคำขอ (Request Header)
| คีย์ | ค่า | คำอธิบาย |
|---|---|---|
| api-key | {YOUR_API_Key} |
พารามิเตอร์พาธ (Path Parameter)
| คีย์ | ค่า | คำอธิบาย |
|---|---|---|
| Floor ID | {YOUR_Floor_ID} | ID เฉพาะของ Floor ที่ต้องการค้นหา |
📦 Response Body ของ API GeoJSON ตามชั้น
200
{
"type": "FeatureCollection",
"features": [
{
"id": "a",
"type": "Feature",
"properties": {
"strokeWidth": null,
"fillColor": "#000000",
"fillOpacity": 0.1,
"name": "11",
"description": "description",
"id": "a",
"type": "room",
"opacity": 0.1,
"strokeColor": "#121212",
"floor": 1,
"strokeOpacity": 0.3
},
"geometry": {
"coordinates": [
[
[0.0435671459188, 0.064528736370684],
[0.04333966963383, 0.06419007191247],
[0.04286786740095, 0.06438865516686],
[0.04309534368592, 0.06472731871907],
[0.0435671459188, 0.064528736370684],
[0.0435671459188, 0.064528736370684]
]
],
"type": "Polygon"
}
},
{
"id": "L1",
"type": "Feature",
"properties": {
"strokeWidth": 1.0,
"name": null,
"id": "L1",
"type": "door",
"strokeColor": "#DD0000",
"floor": 1,
"direction": null
},
"geometry": {
"coordinates": [
[0.04505689, 0.069756232],
[0.045258056, 0.069280658],
[0.04481415, 0.069379913],
[0.044604267, 0.069393183],
[0.044604267, 0.069393183]
],
"type": "LineString"
}
}
]
}
400
{
"error": "Invalid request"
}
💻 ตัวอย่าง cURL เรียก geojson ของชั้น
curl --location 'https://space.api-freegrow.com/open-api/v1/map/floor/1'
--header 'api-key: {YOUR_API_KEY}'
เอกสารที่เกี่ยวข้อง
- คู่มือทั่วไป GrowStudio API
- เรียก Place UID List
- เรียก Details ตาม Place UID
- แก้ไข Details ตาม Place UID
- เรียก Project geojson
- แก้ไข map color ตาม Place
หากต้องการทราบวิธีใช้บริการ ดูคู่มือ GrowStudio ได้ที่นี่