Analytics

Heatmap

Heatmap

The heatmap represents the depth of the tire treads. The color gradient in the heatmap indicates the depth of the treads, with different colors representing different depth levels (other parts of the tire are represented in black). This allows for quick and easy identification of areas with significant wear.

As with the results, after the upload of your scanned frames is completed (that is, the TireTreadScanView's callback method onUploadCompleted was invoked), your tire’s heatmap may still take a few seconds to become available. To fetch the heatmap, call the function getHeatmap(measurementUuid):

  • Kotlin

  • Swift

private fun loadHeatmap(measurementUuid: String) {
    Log.d("MY_APP", "Loading Heatmap for UUID - $measurementUuid - ...")

    AnylineTireTreadSdk.getHeatmap(measurementUuid, onSuccess = { heatmap: Heatmap ->
        Log.i("MY_APP", heatmap.url)
    },
    onFailure = { error: MeasurementError ->
        Log.e("MY_APP", "Error ${error.errorCode}: ${error.errorMessage}")
    })
}
private func loadHeatmap() {
    do {
        AnylineTireTreadSdk.companion.getHeatmap(
            measurementUuid: self.uuid,
            onSuccess: { heatmap in
                print("Heatmap: " + heatmap.url)
            },
            onFailure: { measurementError in
                print("Error " + measurementError.errorCode + ": " + measurementError.errorMessage)
            },timeoutSeconds: 60)
    }
}

Once the heatmap is available, the onSuccess callback will be called with the Heatmap object containing an URL for it.

This URL is only valid for 15 minutes. Make sure to save the image or use the getHeatmap function again to obtain a new URL.

In case of any failure, the onFailure callback will be called containing the MeasurementError object, where you can find the error code and message.

A timeoutSeconds parameter defines for how long the heatmap fetching can run before interrupted (in case of bad network connection, etc.). Required on iOS. On Android, defaults to 60 seconds if not informed.