Authored by Justin R. Miller

Merge branch 'develop' into release

Changelog
---------
### 1.6.1
#### April 25, 2015
- Allow requirement for iOS 8 location services to be satisified both "always" and "when in use" modes.
- Fixed a bug when checking the types of tile sources that can be taken offline.
- Better developer warnings around when a Mapbox access token is required.
- Fixed a visual glitch with the user location dot.
- Improvements and fixes to CocoaPods installation method.
### 1.6.0
#### February 4, 2015
... ...
... ... @@ -456,9 +456,9 @@
+ (NSString *)pathForBundleResourceNamed:(NSString *)name ofType:(NSString *)extension
{
NSAssert([[NSBundle mainBundle] pathForResource:@"Mapbox" ofType:@"bundle"], @"Resource bundle not found in application.");
NSAssert([[NSBundle bundleForClass:[self class]] pathForResource:@"Mapbox" ofType:@"bundle"], @"Resource bundle not found in application.");
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Mapbox" ofType:@"bundle"];
NSString *bundlePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Mapbox" ofType:@"bundle"];
NSBundle *resourcesBundle = [NSBundle bundleWithPath:bundlePath];
return [resourcesBundle pathForResource:name ofType:extension];
... ... @@ -3319,7 +3319,9 @@
//
if ([CLLocationManager instancesRespondToSelector:@selector(requestWhenInUseAuthorization)])
{
NSAssert([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"], @"For iOS 8 and above, your app must have a value for NSLocationWhenInUseUsageDescription in its Info.plist");
BOOL hasLocationDescription = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"] ||
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysUsageDescription"];
NSAssert(hasLocationDescription, @"For iOS 8 and above, your app must have a value for NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription in its Info.plist");
[_locationManager requestWhenInUseAuthorization];
}
#endif
... ...
... ... @@ -70,6 +70,8 @@
{
if (self = [super init])
{
NSAssert([[[RMConfiguration sharedInstance] accessToken] length], @"an access token is required to use Mapbox map tiles");
_dataQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL);
_infoDictionary = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:[tileJSON dataUsingEncoding:NSUTF8StringEncoding]
... ... @@ -162,9 +164,18 @@
options:NSAnchoredSearch & NSBackwardsSearch
range:NSMakeRange(0, [[referenceURL absoluteString] length])]];
}
if ([[referenceURL pathExtension] isEqualToString:@"json"] && (dataObject = [NSString brandedStringWithContentsOfURL:referenceURL encoding:NSUTF8StringEncoding error:nil]) && dataObject)
NSError *error = nil;
if ([[referenceURL pathExtension] isEqualToString:@"json"] && (dataObject = [NSString brandedStringWithContentsOfURL:referenceURL encoding:NSUTF8StringEncoding error:&error]) && dataObject)
{
if (error && [error.domain isEqual:NSURLErrorDomain] && error.code == -1012)
{
#ifdef DEBUG
NSAssert(![[dataObject lowercaseString] hasSuffix:@"invalid token\"}"], @"invalid token in use");
#endif
}
return [self initWithTileJSON:dataObject enablingDataOnMapView:mapView];
}
... ... @@ -360,7 +371,7 @@
+ (BOOL)isUsingLargeTiles
{
return ([[RMConfiguration sharedInstance] accessToken] && [[UIScreen mainScreen] scale] > 1.0);
return ([[UIScreen mainScreen] scale] > 1.0);
}
- (NSString *)uniqueTilecacheKey
... ...
... ... @@ -140,6 +140,8 @@
- (id)initWithMapboxMarkerImage:(NSString *)symbolName tintColorHex:(NSString *)colorHex sizeString:(NSString *)sizeString
{
NSAssert([[[RMConfiguration sharedInstance] accessToken] length], @"an access token is required to use Mapbox markers");
BOOL useRetina = ([[UIScreen mainScreen] scale] > 1.0);
NSURL *imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.tiles.mapbox.com/v4/marker/pin-%@%@%@%@.png%@",
... ...
... ... @@ -41,7 +41,7 @@
if (!(self = [super init]))
return nil;
NSAssert([_source isKindOfClass:[RMAbstractWebMapSource class]], @"only web-based tile sources are supported for downloading");
NSAssert([source isKindOfClass:[RMAbstractWebMapSource class]], @"only web-based tile sources are supported for downloading");
_tile = tile;
_source = source;
... ...
... ... @@ -94,7 +94,7 @@
//
CGFloat whiteWidth = 24.0;
CGRect rect = CGRectMake(0, 0, whiteWidth * 1.25, whiteWidth * 1.25);
CGRect rect = CGRectMake(0, 0, whiteWidth * 1.5, whiteWidth * 1.5);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, [[UIScreen mainScreen] scale]);
CGContextRef context = UIGraphicsGetCurrentContext();
... ...
Pod::Spec.new do |m|
m.name = 'Mapbox-iOS-SDK'
m.version = '1.6.0'
m.version = '1.6.1'
m.summary = 'An open source toolset for building mapping applications for iOS devices.'
m.description = 'An open source toolset for building mapping applications for iOS devices with great flexibility for visual styling, offline use, and customizability.'
... ... @@ -11,18 +11,53 @@ Pod::Spec.new do |m|
m.screenshot = 'https://raw.github.com/mapbox/mapbox-ios-sdk/packaging/screenshot.png'
m.social_media_url = 'https://twitter.com/Mapbox'
m.source = { :git => 'https://github.com/mapbox/mapbox-ios-sdk.git', :tag => m.version.to_s }
m.source = {
:git => 'https://github.com/mapbox/mapbox-ios-sdk.git',
:tag => m.version.to_s
}
m.platform = :ios
m.ios.deployment_target = '5.0'
m.requires_arc = true
m.source_files = 'Proj4/*.h', 'MapView/Map/*.{h,c,m}'
m.module_name = 'Mapbox_iOS_SDK'
m.requires_arc = true
m.source_files = 'Proj4/proj_api.h', 'MapView/Map/*.{h,c,m}'
m.prefix_header_file = 'MapView/MapView_Prefix.pch'
m.resource_bundle = { 'Mapbox' => 'MapView/Map/Resources/*' }
m.public_header_files = [
'Mapbox.h',
'RMAnnotation.h',
'RMCacheObject.h',
'RMCircle.h',
'RMCircleAnnotation.h',
'RMCompositeSource.h',
'RMConfiguration.h',
'RMCoordinateGridSource.h',
'RMDatabaseCache.h',
'RMGreatCircleAnnotation.h',
'RMInteractiveSource.h',
'RMMBTilesSource.h',
'RMMapboxSource.h',
'RMMapView.h',
'RMMapViewDelegate.h',
'RMMarker.h',
'RMMemoryCache.h',
'RMPointAnnotation.h',
'RMPolygonAnnotation.h',
'RMPolylineAnnotation.h',
'RMShape.h',
'RMStaticMapView.h',
'RMTileCache.h',
'RMTileMillSource.h',
'RMUserLocation.h',
'RMUserTrackingBarButtonItem.h'
]
m.resource_bundle = {
'Mapbox' => 'MapView/Map/Resources/*'
}
m.documentation_url = 'https://www.mapbox.com/mapbox-ios-sdk'
... ... @@ -30,7 +65,10 @@ Pod::Spec.new do |m|
m.libraries = 'Proj4', 'sqlite3', 'z'
m.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC', 'LIBRARY_SEARCH_PATHS' => '"${PODS_ROOT}/Mapbox-iOS-SDK/Proj4"' }
m.xcconfig = {
'OTHER_LDFLAGS' => '-ObjC',
'LIBRARY_SEARCH_PATHS' => '"${PODS_ROOT}/Mapbox-iOS-SDK/Proj4"'
}
m.preserve_paths = 'MapView/MapView.xcodeproj', 'MapView/Map/Resources'
... ...