Racemap

Racemap makes the data of it's trackers available via an easy Web API. This URL is individual per event.

The data in this API contains each tracker's distance to start and from finish and many other data.

Get Distance from start from leading vehicles

In this example, we want to fetch the distance to finish from the lead vehicle's tracker.

First we need to setup a global list with the URL provided by Racemap and name it Racemap:

In a script, we can now access the data via the Racemap.Data variable. We loop through all trackers and find tghe one matching the lead vehicle tracker id. And then fetch the toFinish property.

{{
# Define tracker ID
leadTrackerId = "66bf4318d1c783279d183e37"
leadTrackerFound = false

# Loop through all trackers and pick the one we are interested in
for tracker in Racemap.Data.starters
    if (tracker.id == leadTrackerId)
        leadTrackerFound = true
        distanceToFinish = tracker.current.toFinish
    end
end

# Show texts based on distance
if leadTrackerFound
    if distanceToFinish > 0
        "Distance to Finish: " + ((distanceToFinish / 1000) | Format "####0.0") + "km"
     else 
       "Finished"
     end
else 
    "Tracker not found"
end
}}

Last updated