summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-05-16 20:26:28 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-05-16 20:26:28 -0700
commit563fed5ca93273342366c54be8f619c12b514417 (patch)
treebf7052c3835e9d0f13984a4c0ecd994e397c7b4a /platform
parent9ceda19363848d18db3aaf3edcbbada7dc96dd05 (diff)
downloadqtlocation-mapboxgl-563fed5ca93273342366c54be8f619c12b514417.tar.gz
Properly fail to load the map
A typo in a selector literal meant that `-[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:]` would never be sent to delegates even if `MGLMapView` had called it. Along for the ride, create a proper `NSError` to pass into that callback, and an error domain for that error.
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/MGLMapView.mm5
-rw-r--r--platform/ios/MGLTypes.m3
2 files changed, 6 insertions, 2 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index ff31ec9e1a..dfbb034398 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -2352,9 +2352,10 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
}
case mbgl::MapChangeDidFailLoadingMap:
{
- if ([self.delegate respondsToSelector:@selector(mapViewDidFailLoadingMap:withError::)])
+ if ([self.delegate respondsToSelector:@selector(mapViewDidFailLoadingMap:withError:)])
{
- [self.delegate mapViewDidFailLoadingMap:self withError:nil];
+ NSError *error = [NSError errorWithDomain:MGLErrorDomain code:0 userInfo:nil];
+ [self.delegate mapViewDidFailLoadingMap:self withError:error];
}
break;
}
diff --git a/platform/ios/MGLTypes.m b/platform/ios/MGLTypes.m
new file mode 100644
index 0000000000..01e9a1467c
--- /dev/null
+++ b/platform/ios/MGLTypes.m
@@ -0,0 +1,3 @@
+#import "MGLTypes.h"
+
+NSString * const MGLErrorDomain = @"MGLErrorDomain";