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 - The id of an image uploaded to the Files endpoint.
  • link - A downloadable link to that image's location in storage.

📘

NOTE:

The link property 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:

  1. latitude - The latitudinal position of a geographic coordinate.
  2. longitude - The longitudinal position of a geographic coordinate.
  3. accuracy - The accuracy of the captured geographic coordinate.

📘

NOTE:

The accuracy property of a location is 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...
 }
}