MTPerformancePresets

public enum MTPerformancePresets

Performance-oriented presets for MapTiler Swift SDK.

  • Lean performance preset: prioritize responsiveness and bytes over fidelity.

    Applied overrides (favor performance over fidelity):

    • pixelRatio = 1.0
    • shouldRefreshExpiredTiles = false
    • cancelPendingTileRequestsWhileZooming = true
    • maxTileCacheZoomLevels = 4.0 (if unset)
    • crossSourceCollisionsAreEnabled = false
    • eventLevel = ESSENTIAL (keeps low-frequency events; per-frame events opt-in)
    • highFrequencyEventThrottleMs = 150 (when ALL is enabled)

    Declaration

    Swift

    public static func leanPerformance(base: MTMapOptions = MTMapOptions()) -> MTMapOptions
  • Returns a new [MTMapOptions] based on [base] with balanced performance defaults.

    Keeps crisper rendering by using a higher pixel ratio.

    Applied overrides:

    • pixelRatio = base.pixelRatio ?: 1.5 (sharper than 1.0)
    • shouldRefreshExpiredTiles = false
    • cancelPendingTileRequestsWhileZooming = true
    • maxTileCacheZoomLevels = 4.0 (if unset)
    • crossSourceCollisionsAreEnabled = false
    • eventLevel = ESSENTIAL (per-frame events opt-in)
    • highFrequencyEventThrottleMs = 150 (when ALL is enabled)

    Declaration

    Swift

    public static func balancedPerformance(base: MTMapOptions = MTMapOptions()) -> MTMapOptions
  • Returns a new [MTMapOptions] based on [base] tuned for higher-end devices.

    Focuses on visual fidelity while keeping sensible performance guardrails.

    Applied overrides:

    • pixelRatio = base.pixelRatio ?: 2.0 (very crisp; test for memory on low-end)
    • shouldRefreshExpiredTiles = true (prefer up-to-date tiles)
    • cancelPendingTileRequestsWhileZooming = false (allow progressive detail during zoom)
    • maxTileCacheZoomLevels = 6.0 (if unset) to reduce churn when navigating
    • crossSourceCollisionsAreEnabled = base.crossSourceCollisionsAreEnabled ?: true
    • eventLevel = ALL
    • highFrequencyEventThrottleMs = 100 (slightly more responsive when ALL is enabled)

    Declaration

    Swift

    public static func highFidelity(base: MTMapOptions = MTMapOptions()) -> MTMapOptions