Reference
Timeline

Timeline

Every map controller instance is initialized with a corresponding timeline which is responsible for managing the times used when requesting weather data and animating that weather data across a time series. While the MapsGL SDK will automatically manage date and time information as needed for each weather-related layer (opens in a new tab)and data source added to a map controller, you can use the following public interface for controlling the timeline and animation playback.

Since a timeline is initialized by MapController instances, you don't need to create your own Timeline instance. Instead, update your timeline options after instantiating your MapController instance:

let account = XweatherAccount(id: "CLIENT_ID", secret: "CLIENT_SECRET")
let mapController = MapboxMapController(map: mapView, account: account)
 
// Configure the timeline
mapController.timeline.duration = 2
mapController.timeline.endDelay = 1
mapController.timeline.setStartDate(usingOffset: -48 * 3600) // 2 days ago

Refer to the Timeline API reference for more information about the available properties and methods.