Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Updated change logs. Changed error code to be clear that it was devel…
Browse files Browse the repository at this point in the history
…oper initiated.
  • Loading branch information
Julian Rex committed Jul 10, 2018
1 parent a952bc6 commit 0806bbb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions platform/darwin/src/MGLMapSnapshotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ MGL_EXPORT
Once you call this method, you cannot resume the snapshot. In order to obtain
the snapshot, create a new `MGLMapSnapshotter` object.
The completion handler will be called with an `NSError` with domain
`MGLErrorDomain` and error code `MGLErrorCodeSnapshotUserCancelled`.
*/
- (void)cancel;

Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLMapSnapshotter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ + (CGSize)attributionTextSizeWithStyle:(MGLAttributionInfoStyle)attributionStyle
- (void)cancel
{
if (_snapshotCallback) {
[MGLMapSnapshotter completeWithErrorCode:MGLErrorCodeSnapshotCancelled
description:@"MGLMapSnapshotter cancelled."
[MGLMapSnapshotter completeWithErrorCode:MGLErrorCodeSnapshotUserCancelled
description:[NSString stringWithFormat:@"MGLMapSnapshotter cancelled from %s", __PRETTY_FUNCTION__]
onQueue:self.resultQueue
completion:self.completion];
self.completion = nil;
Expand Down
2 changes: 1 addition & 1 deletion platform/darwin/src/MGLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef NS_ENUM(NSInteger, MGLErrorCode) {
/** An error occurred while snapshotting the map. */
MGLErrorCodeSnapshotFailed = 6,
/** The user cancelled a map snapshot. */
MGLErrorCodeSnapshotCancelled = 7,
MGLErrorCodeSnapshotUserCancelled = 7,
};

/** Options for enabling debugging features in an `MGLMapView` instance. */
Expand Down
6 changes: 6 additions & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started.

## master

### Other changes

* Changed `-[MGLMapSnapshotter cancel]` to call the completion block (originally passed to `-[MGLMapSnapshotter startWithQueue:completionHandler:]`) with an `NSError` (error code `MGLErrorCodeSnapshotUserCancelled`) if the snapshot has not finished. ([#12355](https://github.com/mapbox/mapbox-gl-native/pull/12355))

## 4.2.0

### Packaging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ - (void)testCancellingSnapshot {

MGLTestAssertNil(strongself, snapshot);
MGLTestAssert(strongself,
([error.domain isEqualToString:MGLErrorDomain] && error.code == MGLErrorCodeSnapshotCancelled),
([error.domain isEqualToString:MGLErrorDomain] && error.code == MGLErrorCodeSnapshotUserCancelled),
@"Should have been cancelled");
[expectation fulfill];
}];
Expand Down
2 changes: 2 additions & 0 deletions platform/macos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Fixed an issue where `-[MGLMapShapshot pointForCoordinate:]` returned incorrect points. ([#12221](https://github.com/mapbox/mapbox-gl-native/pull/12221))
* Improved caching performance. ([#12072](https://github.com/mapbox/mapbox-gl-native/pull/12072))
* Remove unnecessary memory use when collision debug mode is disabled. ([#12294](https://github.com/mapbox/mapbox-gl-native/issues/12294))
* Changed `-[MGLMapSnapshotter cancel]` to call the completion block (originally passed to `-[MGLMapSnapshotter startWithQueue:completionHandler:]`) with an `NSError` (error code `MGLErrorCodeSnapshotUserCancelled`) if the snapshot has not finished. ([#12355](https://github.com/mapbox/mapbox-gl-native/pull/12355))


## 0.8.0 - June 20, 2018

Expand Down

0 comments on commit 0806bbb

Please sign in to comment.