The Gps Field is responsible for storing a geographic image with coordinates.
{
"Job Site Location": {
"location": {
"latitude": 32.7159063,
"longitude": -117.1685657,
"accuracy": null
},
"mapImage": {
"id": "68d32c9b-d87c-44af-957d-b6b4477791b8",
"link": "https://api.goformz.com/v2/files/68d32c9b-d87c-44af-957d-b6b4477791b8"
},
"id": "05bff11f-0674-438e-964f-a46c0108d3ca",
"name": "Location",
"type": "Gps"
}
}
NOTE:The id, name, and type are not necessary when setting or updating the Sketch Field. These properties are returned in the JSON of the request for readability.
The mapImage property is a File property type and each has the following properties:
id- Theidof an image uploaded to theFilesendpoint.link- A downloadablelinkto that image's location in storage.
NOTE:The
linkproperty is read-only and will not be persisted if it is updated.
The mapImage file requires uploading a File first and then assigning that uploaded file's id to the mapImage > id property. For more details see the section: "Uploading a file".
Location
In addition to the mapImage property, the Gps Field also contains a location property which can be set to capture the geographic coordinates associated with the mapImage.
The location property has three properties:
latitude- The latitudinal position of a geographic coordinate.longitude- The longitudinal position of a geographic coordinate.accuracy- The accuracy of the captured geographic coordinate.
NOTE:The
accuracyproperty of alocationis optional.
The following JSON snippet shows how to set the location:
{
"location": {
"latitude": 32.715410,
"longitude": -117.168705,
// accuracy omitted since it's not required...
}
}