|
| 1 | +# GTT API |
| 2 | + |
| 3 | +## Global Level API Endpoint |
| 4 | +### API Endpoint |
| 5 | +``` |
| 6 | +GET /gtt/settings.json |
| 7 | +``` |
| 8 | +Get all the GTT default settings and also all the global GTT layers data. |
| 9 | + |
| 10 | +***Request*** |
| 11 | +``` |
| 12 | +http://localhost:3000/gtt/settings.json |
| 13 | +``` |
| 14 | + |
| 15 | +***Response*** |
| 16 | +```json |
| 17 | +{ |
| 18 | + "gttDefaultSetting": { |
| 19 | + "defaultTrackerIcon": [ |
| 20 | + { |
| 21 | + "trackerID": "1", |
| 22 | + "trackerName": "Task", |
| 23 | + "icon": "maki-square" |
| 24 | + }, |
| 25 | + ], |
| 26 | + "defaultStatusColor": [ |
| 27 | + { |
| 28 | + "statusID": "1", |
| 29 | + "statusName": "New", |
| 30 | + "color": "#00ff00" |
| 31 | + }, |
| 32 | + ], |
| 33 | + "defaultMapSetting": { |
| 34 | + "centerLng": "135.35740", |
| 35 | + "centerLat": "34.74701" |
| 36 | + }, |
| 37 | + "geometrySetting": { |
| 38 | + "geometryTypes": [ |
| 39 | + "Point", |
| 40 | + "LineString", |
| 41 | + "Polygon" |
| 42 | + ], |
| 43 | + "GeoJsonUpload": null |
| 44 | + }, |
| 45 | + "geocoderSetting": { |
| 46 | + "enableGeocodingOnMap": "true", |
| 47 | + "geocoderOptions": "{}" |
| 48 | + } |
| 49 | + }, |
| 50 | + "gttLayer": [ |
| 51 | + { |
| 52 | + "id": 1, |
| 53 | + "name": "OSM", |
| 54 | + "type": "ol.source.OSM", |
| 55 | + "options": { |
| 56 | + "url": "https://tile.openstreetmap.jp/{z}/{x}/{y}.png", |
| 57 | + "custom": "17/34.74701/135.35740", |
| 58 | + "crossOrigin": null, |
| 59 | + "attributions": "<a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>" |
| 60 | + }, |
| 61 | + }, |
| 62 | + { |
| 63 | + "id": 2, |
| 64 | + "name": "GIS Satellite Map", |
| 65 | + "type": "ol.source.XYZ", |
| 66 | + "options": { |
| 67 | + "url": "https://cyberjapandata.gsi.go.jp/xyz/seamlessphoto/{z}/{x}/{y}.jpg", |
| 68 | + "maxZoom": 18, |
| 69 | + "minZoom": 0, |
| 70 | + "attributions": "<a href=\"https://portal.cyberjapan.jp/help/termsofuse.html\" target=\"_blank\">GISSateliteMap</a>" |
| 71 | + }, |
| 72 | + } |
| 73 | + ] |
| 74 | +} |
| 75 | +``` |
| 76 | + |
| 77 | +## Project Level API Endpoint |
| 78 | +### API Endpoint |
| 79 | +``` |
| 80 | +GET /projects/{project_identifier}.json |
| 81 | +``` |
| 82 | +Get project and selected GTT layer data of a specific project. |
| 83 | + |
| 84 | +***Request*** |
| 85 | +``` |
| 86 | +http://localhost:3000/projects/1.json |
| 87 | +``` |
| 88 | +***Response*** |
| 89 | +```json |
| 90 | +{ |
| 91 | + "project": { |
| 92 | + "id": 1, |
| 93 | + "name": "first testing project ", |
| 94 | + "identifier": "first-testing-project", |
| 95 | + "description": "", |
| 96 | + "homepage": "", |
| 97 | + "status": 1, |
| 98 | + "is_public": false, |
| 99 | + "geojson": "", |
| 100 | + "gttLayer": [ |
| 101 | + { |
| 102 | + "id": 1, |
| 103 | + "name": "OSM", |
| 104 | + "type": "ol.source.OSM", |
| 105 | + "options": { |
| 106 | + "url": "https://tile.openstreetmap.jp/{z}/{x}/{y}.png", |
| 107 | + "custom": "17/34.74701/135.35740", |
| 108 | + "crossOrigin": null, |
| 109 | + "attributions": "<a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>" |
| 110 | + }, |
| 111 | + "created_at": "2022-06-29T09:07:12.574Z", |
| 112 | + "updated_at": "2022-07-05T07:33:09.237Z", |
| 113 | + "global": true, |
| 114 | + "default": true, |
| 115 | + "position": 0, |
| 116 | + "baselayer": true |
| 117 | + } |
| 118 | + ], |
| 119 | + "created_on": "2022-06-29T09:08:38Z", |
| 120 | + "updated_on": "2022-06-29T09:08:38Z" |
| 121 | + } |
| 122 | +} |
| 123 | +``` |
| 124 | + |
0 commit comments