Configuration

Configuring a Weather Map

A weather map's configuration provides numerous ways to customize how your weather map functions. Each AWFWeatherMap object contains a config property that is an instance of AWFWeatherMapConfig which provides these options and settings to the weather map.

The simplest way to customize your weather map is to set the properties on the default configuration instance directly:

weatherMap.config.animationEnabled = false
weatherMap.config.refreshInterval = 15 * AWFMinuteInterval

If you need to use the same weather map configuration across multiple weather map instances or would rather store the configuration within its own object, you can also subclass AWFWeatherMapConfig and override the properties at initialization:

class MyWeatherMapConfig: AWFWeatherMapConfig {
    
    override init() {
        super.init()
        
        self.refreshInterval = 15 * AWFMinuteInterval
        self.animationEnabled = false
    }
}

Then you would provide your custom configuration object when instantiating a weather map:

let weatherMap = AWFWeatherMap(mapType: .apple, config: MyWeatherMapConfig())

Note that once a weather map has been initialized, its config property is read-only and cannot be changed. Therefore, any configuration changes required afterwards must be done on the configuration object directly.

Refer to the AWFWeatherMapConfig API reference for the complete list of properties and methods supported.