Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose memory budget API #1288

Merged
merged 2 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Mapbox welcomes participation and contributions from everyone.
* Fix localization crash on iOS 11 and 12. ([#1278](https://github.com/mapbox/mapbox-maps-ios/pull/1278))
* Increase tap target to conform to Apple Human Interface guidelines. ([#1283](https://github.com/mapbox/mapbox-maps-ios/pull/1283))
* Update to MapboxCoreMaps 10.5.0-rc.1 and MapboxCommon 21.3.0-rc.2. ([#1281](https://github.com/mapbox/mapbox-maps-ios/pull/1281))
* Expose API to set memory budget for `MapboxMap`. ([#1288](https://github.com/mapbox/mapbox-maps-ios/pull/1288))

## 10.5.0-beta.1 - April 7, 2022

Expand Down
15 changes: 15 additions & 0 deletions Sources/MapboxMaps/Foundation/MapboxMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ public final class MapboxMap: MapboxMapProtocol {
__map.reduceMemoryUse()
}

/// The memory budget hint to be used by the map. The budget can be given in
/// tile units or in megabytes. A Map will do its best to keep the memory
/// allocations for non-essential resources within the budget.
///
/// The memory budget distribution and resource
/// eviction logic is subject to change. Current implementation sets a memory budget
/// hint per data source.
///
/// If nil is set, the memory budget in tile units will be dynamically calculated based on
/// the current viewport size.
/// - Parameter memoryBudget: The memory budget hint to be used by the Map.
@_spi(Experimental) public func setMemoryBudget(_ memoryBudget: MapMemoryBudget?) {
__map.__setMemoryBudgetFor(memoryBudget)
}

/// Gets the resource options for the map.
///
/// All optional fields of the returned object are initialized with the
Expand Down