Merge pull request #1577 from mapbox/1ec5-did-fail-to-fail

Properly fail to load the map
This commit is contained in:
Minh Nguyễn
2015-05-16 20:37:44 -07:00
4 changed files with 9 additions and 2 deletions

View File

@@ -35,6 +35,7 @@
'../platform/ios/MGLUserLocationAnnotationView.h',
'../platform/ios/MGLUserLocationAnnotationView.m',
'../include/mbgl/ios/MGLTypes.h',
'../platform/ios/MGLTypes.m',
'../platform/ios/NSBundle+MGLAdditions.h',
'../platform/ios/NSBundle+MGLAdditions.m',
'../platform/ios/NSException+MGLAdditions.h',

View File

@@ -1,5 +1,7 @@
#import <Foundation/Foundation.h>
extern NSString * const MGLErrorDomain;
/** The mode used to track the user location on the map. */
typedef NS_ENUM(NSUInteger, MGLUserTrackingMode)
{

View File

@@ -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;
}

3
platform/ios/MGLTypes.m Normal file
View File

@@ -0,0 +1,3 @@
#import "MGLTypes.h"
NSString * const MGLErrorDomain = @"MGLErrorDomain";