MTConfig
public actor MTConfig
Object representing the SDK global settings.
Exposes properties and options such as API Key and caching preferences.
-
Declaration
Swift
public static let shared: MTConfig -
SDK log level.
Declaration
Swift
public private(set) var logLevel: MTLogLevel { get } -
Boolean indicating whether caching is enabled.
Note
Defaults to true.Declaration
Swift
public private(set) var isCachingEnabled: Bool { get } -
Boolean indicating whether session logic is enabled.
This allows MapTiler to enable “session based billing”.
Note
Defaults to true.See also
https://docs.maptiler.com/guides/maps-apis/maps-platform/what-is-map-session-in-maptiler-cloud/Declaration
Swift
public private(set) var isSessionLogicEnabled: Bool { get } -
Boolean indicating whether telemetry is enabled.
The telemetry is very valuable to the team at MapTiler because it shares information about where to add the extra effort. It also helps spotting some incompatibility issues that may arise between the SDK and a specific version of a module. It consist in sending the SDK version, API Key, MapTiler session ID, if tile caching is enabled, if language specified at initialization, if terrain is activated at initialization, if globe projection is activated at initialization.
Note
Defaults to true.Declaration
Swift
public private(set) var isTelemetryEnabled: Bool { get } -
Sets the SDK log level.
Declaration
Swift
public func setLogLevel(_ level: MTLogLevel)Parameters
levelThe desired SDK log level.
-
Sets the MapTiler API key.
Declaration
Swift
public func setAPIKey(_ apiKey: String, for map: MTMapView? = nil)Parameters
apiKeyThe MapTiler API Key.
mapMap view to apply to.
-
Returns the MapTiler API key.
Declaration
Swift
public func getAPIKey() -> String? -
Sets the caching mechanism.
Note
Enabled by defaultDeclaration
Swift
public func setCaching(_ isEnabled: Bool, for map: MTMapView)Parameters
isEnabledBoolean indicating whether caching is enabled.
mapMap view to apply to.
-
Sets the session logic.
Make sure to call before map init or use MTMapOptions to supply before map init.
Note
Enabled by defaultSee also
https://docs.maptiler.com/guides/maps-apis/maps-platform/what-is-map-session-in-maptiler-cloud/Declaration
Swift
public func setSessionLogic(_ isEnabled: Bool, for map: MTMapView)Parameters
isEnabledBoolean indicating whether session logic is enabled.
mapMap view to apply to.
-
Returns the unit of measurement.
Declaration
Swift
public func getUnit() -> MTUnit? -
Sets the telemetry.
Note
Enabled by defaultDeclaration
Swift
public func setTelemetry(_ isEnabled: Bool, for map: MTMapView)Parameters
isEnabledBoolean indicating whether telemetry is enabled.
mapMap view to apply to.