| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
the default RunLoop
When linking Mapbox GL as a static library, the object file (MGLFoundation.o) containing the global static variable initialization was not linked into the resulting binary since it was not referenced. This resulted in the RunLoop not being initialized in the main thread.
Reverts 03a14ff0003e976a4ded70d284bc80adf54bc6c9
|
|
|
|
|
|
|
|
|
|
|
| |
This uses the pause/resume API on the default file source to pause
network and revalidation activity when the host iOS application goes
into the background. Activity is resumed when the host application goes
into the foreground.
The intention of this change is to avoid edge cases on some OSs where
resources (i.e. sqlite) are not available when the host app is not
visible to the user.
|
| |
|
|
|
|
|
|
|
| |
This commit also gets rid of private `MGLOfflinePackDelegate` protocol.
`userInfo` dictionary in notification objects retain the `state` and
`progress` values for backwards compatibility. They can be removed in
later major release.
|
| |
|
|
|
|
| |
Renamed MGLGeoJSONSourceOption and MGLOfflinePackUserInfoKey constants for clarity and to remove redundancy in the Swift-bridged names. Left the old MGLOfflinePackUserInfoKey constants in place as deprecated aliases.
|
| |
|
| |
|
|
|
|
|
|
| |
Added a property to MGLOfflineStorage that indicates the disk space occupied by all cached and offline resources.
Fixes #5580.
|
|
|
|
|
|
|
|
|
|
|
| |
We cannot guarantee that the offline/ambient tile cache (cache.db) will be created in a timely manner, so it's safer to set the backup exclusion key on its containing directory.
But, because we placed cache.db in the base of the app's Application Support directory (where backups are expected to be allowed), we need to move cache.db into a directory that we control and can exclude from backups with impunity.
This is an amalgam of https://github.com/mapbox/mapbox-gl-native/pull/5578 (directory exclusion) and https://github.com/mapbox/mapbox-gl-native/pull/5585 (refactored URL methods, but without the new database size method).
Also:
* Prefix mapbox subdirectory with dot, for extra safety
* Update changelog entry with new ticket, less speculation
|
|
|
| |
Speculatively fixes #511, where apps mistakenly backup the offline/ambient cache.
|
|
|
|
| |
Consolidated NSValue categories to work around realm/jazzy#539. Documented MGLErrorCode. Moved jazzy configuration file into platform/ios/. Removed redundant include/Mapbox.h that was only being used by jazzy, now that the static frameworks’s umbrella header is based on that of the dynamic framework. Moved framework/Mapbox.h to include/Mapbox.h for consistency.
|
|
|
|
| |
Requesting progress is expensive, so it is once again computed only on demand, rather than automatically at launch. Moved progress requesting back to iosapp and osxapp.
|
|
|
|
| |
An MGLOfflinePackProgressChangedNotification notification now includes the pack’s state and progress values, which match the values in the corresponding MGLOfflinePack properties. Implemented NSValue category methods to store MGLOfflinePackProgress inside a dictionary.
|
|
|
|
| |
Fixed an incomplete variable renaming. Don’t bother creating intermediate directories to the legacy cache path. When the main bundle lacks a bundle identifier, as is the case when the SDK runs in the test bundle, fall back on the SDK’s bundle.
|
|
|
|
|
|
| |
Removed NS_UNAVAILABLE attribute from -[MGLOfflinePack init]. Packs initialized with this initializer are doomed to invalidity.
Fixes #4421.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
fewer reloads
Made MGLOfflineStorage.packs strong rather than copy so that KVO notifications on that key path include index paths. Replaced custom KVO mutable collection methods with calls to -mutableArrayValueForKey:, avoiding redundant casts.
Privatized MGLOfflinePackDelegate and made its methods required, since MGLOfflineStorage is the only conforming implementation. Require a pack to be explicitly invalidated before deallocation by its owner (MGLOfflineStorage). Added a method to reload the canonical collection of packs.
Previously, if the user adds an offline pack without specifying a name in the alert, the pack would be named “Untitled n” for the nth pack created since the application was launched. This logic could result in identically named packs (for example, if the user relaunches and creates another unnamed pack). Instead, use the visible coordinate bounds as a placeholder and fallback name.
Resume a pack upon successful addition. Removed an extraneous weakSelf/strongSelf dance. When possible, update individual labels in a cell instead of reloading the entire cell. That way, if the user swipes to the left to reveal the Delete accessory button while the pack is actively downloading, the accessory button remains on screen as progress updates come in.
|
|
|
|
|
|
| |
MGLOfflineStorage now maintains a centralized, strongly held, KVO-compliant collection of all extant offline packs. MGLOfflineStorage issues notifications for progress updates. Client code can now react to the successful addition of an offline pack either via the completion block or via a KVO insertion.
Fixes #4287.
|
|
|
|
| |
Avoid backing up the offline cache onto iCloud, because it can be redownloaded and would easily take up a significant portion of a standard iCloud account. Ideally, we’d even put ambiently cached resources in Caches, so it can be reclaimed by the system when disk space runs low. But unfortunately it has to live in the same file as offline resources.
|
|
|
|
|
|
| |
There is now only one instance of mbgl::OfflineFileSource, created when the shared MGLOfflineStorage object is initialized. Also create and use the shared MGLOfflineStorage object when initializing an MGLMapView object. The unified cache file is located in a subdirectory of Application Support, where the SDK has control over the file’s lifetime. The subdirectory is already named after the host application’s bundle identifier, ensuring that each Mapbox-powered application has an independent tile limit. If there’s an ambient cache in a subdirectory of Caches, delete it. If there’s an offline cache in a subdirectory of Documents on iOS or Caches on OS X, move it to the unified cache location in a subdirectory of Application Support.
Fixes the iOS/OS X side of #4338.
|
|
|
|
| |
“Offline pack” more effectively communicates the persistent nature of the downloaded content.
|
|
|
|
| |
Fixed a race condition that could occur if a progress update comes after a call to remove the task but before the removal is complete. Avoid synchronously setting the task’s state inside -resume and -suspend; instead, rely on the observer to set the state asynchronously.
|
| |
|
|
|
|
| |
Also categorized offline symbols for jazzy and moved styleURL from MGLOfflineRegion to MGLTilePyramidOfflineRegion, since you never know if there will be a region type not constrained by a style in the future.
|
|
Renamed SDK classes related to offline viewing to more closely match the terminology used by mbgl and the Android SDK while remaining consistent with Cocoa naming principles.
|