Authored by Denis Zamataev

Merge branch 'release'

* release: (22 commits)
  move original project notes aside
  Android --> iOS
  explicit note that this driver cannot be used w unlimited MAU plan
  update URLs for repo-only podspec
  update URLs for legacy vs GL-based
  refs #665: remove old GL section
  refs #665: docs updates for deprecation
  Strengthen GL language, add Swift Offline example
  update private header matches
  bump podspec version
  updated changelog for 1.6.1
  explicit public headers in podspec
  explicit module name
  podpsec formatting improvements
  refs #580: pare down Proj4 headers to barest needed for CocoaPods
  refs #580: properly find CocoaPods-based resource bundle
  Smooth edges of user location annotation icon's shadow
  ensure access token is set for v4 API access
  #578: Unrequire access token for large tiles
  fixes #601: catch bad token during development
  ...

Conflicts:
	Mapbox-iOS-SDK@sputnik.podspec
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
... ...
CONTRIBUTING
------------
If you have a usage question, please email help-at-mapbox.com.
If you want to contribute code:
1. In past, for things that are generally useful to mapping libraries, we encouraged contributions to the upstream project [Alpstein/route-me](http://github.com/alpstein/route-me), from which this project is derived. But that project is no longer active, so you can contribute pull here.
**Please note that this legacy tree of the Mapbox iOS SDK is deprecated. As such, this project is not under active development. The `2.0.0` and above tree, based on code located at https://github.com/mapbox/mapbox-gl-native/, is a complete rewrite based on OpenGL ES and vector map rendering.**
1. Please familiarize yourself with work in [`mapbox-gl-native`](https://github.com/mapbox/mapbox-gl-native), which will eventually be the successor to this codebase. That framework solves lots of problems inherent to a Core Graphics-based framework like this one such as performance and flexibility.
1. Fork and submit a pull request **against the `develop` branch** so that we can review, discuss, and possibly integrate your code.
If you have a usage question, please email help-at-mapbox.com.
... ...
... ... @@ -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];
... ... @@ -3326,7 +3326,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]
... ... @@ -163,8 +165,17 @@
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|
<<<<<<< HEAD:Mapbox-iOS-SDK@sputnik.podspec
m.name = 'Mapbox-iOS-SDK@sputnik'
m.version = '1.6.1-sputnik'
=======
m.name = 'Mapbox-iOS-SDK'
m.version = '1.6.1'
>>>>>>> release:Mapbox-iOS-SDK.podspec
m.summary = 'Fork of MapBox iOS SDK with some patches.'
m.description = 'An open source toolset for building mapping applications for iOS devices with great flexibility for visual styling, offline use, and customizability.'
<<<<<<< HEAD:Mapbox-iOS-SDK@sputnik.podspec
m.homepage = 'https://github.com/sputnik-ru/Mapbox-iOS-SDK'
m.license = 'BSD'
m.author = { 'Denis Zamataev' => 'zamataev@corp.sputnik.ru' }
m.screenshot = 'https://raw.github.com/sputnik-ru/Mapbox-iOS-SDK/packaging/screenshot.png'
m.source = { :git => 'https://github.com/sputnik-ru/Mapbox-iOS-SDK.git', :tag => m.version.to_s }
=======
m.homepage = 'https://mapbox.com/mapbox-ios-sdk-legacy'
m.license = 'BSD'
m.author = { 'Mapbox' => 'mobile@mapbox.com' }
m.screenshot = 'https://raw.github.com/mapbox/mapbox-ios-sdk-legacy/packaging/screenshot.png'
m.social_media_url = 'https://twitter.com/Mapbox'
m.source = {
:git => 'https://github.com/mapbox/mapbox-ios-sdk-legacy.git',
:tag => m.version.to_s
}
>>>>>>> release:Mapbox-iOS-SDK.podspec
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.documentation_url = 'https://www.mapbox.com/mapbox-ios-sdk'
m.public_header_files = [
'MapView/Map/Mapbox.h',
'MapView/Map/RMAnnotation.h',
'MapView/Map/RMCacheObject.h',
'MapView/Map/RMCircle.h',
'MapView/Map/RMCircleAnnotation.h',
'MapView/Map/RMCompositeSource.h',
'MapView/Map/RMConfiguration.h',
'MapView/Map/RMCoordinateGridSource.h',
'MapView/Map/RMDatabaseCache.h',
'MapView/Map/RMGreatCircleAnnotation.h',
'MapView/Map/RMInteractiveSource.h',
'MapView/Map/RMMBTilesSource.h',
'MapView/Map/RMMapboxSource.h',
'MapView/Map/RMMapView.h',
'MapView/Map/RMMapViewDelegate.h',
'MapView/Map/RMMarker.h',
'MapView/Map/RMMemoryCache.h',
'MapView/Map/RMPointAnnotation.h',
'MapView/Map/RMPolygonAnnotation.h',
'MapView/Map/RMPolylineAnnotation.h',
'MapView/Map/RMShape.h',
'MapView/Map/RMStaticMapView.h',
'MapView/Map/RMTileCache.h',
'MapView/Map/RMTileMillSource.h',
'MapView/Map/RMUserLocation.h',
'MapView/Map/RMUserTrackingBarButtonItem.h'
]
m.resource_bundle = {
'Mapbox' => 'MapView/Map/Resources/*'
}
m.documentation_url = 'https://www.mapbox.com/mapbox-ios-sdk-legacy'
m.frameworks = 'CoreGraphics', 'CoreLocation', 'Foundation', 'QuartzCore', 'UIKit'
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'
... ...
Mapbox iOS SDK
--------------
Based on the Route-Me iOS map library (Alpstein fork) with [Mapbox](http://mapbox.com) customizations.
Requires iOS 5 or greater (includes iOS 7+ support at runtime), Xcode 5.0 or greater, and ARC.
[![](https://raw.github.com/mapbox/mapbox-ios-sdk-legacy/packaging/screenshot.png)]()
Major differences from [Alpstein fork of Route-Me](https://github.com/Alpstein/route-me):
* Requires iOS 5.0 and above.
* Supports Automatic Reference Counting (ARC).
* [Mapbox](http://mapbox.com) & [MBTiles](http://mbtiles.org) tile source integration code.
* [Mapbox Markers](http://mapbox.com/blog/markers/) support.
* [UTFGrid interactivity](http://mapbox.com/mbtiles-spec/utfgrid/).
* Improved network tile loading performance.
* A bulk, background map tile downloader for cache pre-population and offline use.
* Annotation callouts that behave like MapKit.
* Annotation convenience subclasses for points and shapes.
* Prepackaged static library.
* [CocoaPods](http://cocoapods.org) support.
* Removal of two-finger double-tap gesture for zoom out (to speed up two-finger single-tap recognition like MapKit).
* Different default starting location for maps.
* Built-in attribution view controller with button on map views & default OpenStreetMap attribution.
* Easy static map view support.
* Removal of included example projects in favor of separate examples on GitHub.
* A few added defaults for convenience.
* Improved documentation.
Route-Me
--------
Route-Me is an open source map library that runs natively on iOS. It's designed to look and feel much like the built-in iOS map library, but it's entirely open, and works with any map source using a pluggable backend system.
Supported map tile sources include [Mapbox](http://mapbox.com/developers/api/)/[TileStream](https://github.com/mapbox/tilestream), the offline-capable, database-backed format [MBTiles](http://mbtiles.org), [OpenStreetMap](http://www.openstreetmap.org), and several others.
Please note that you are responsible for getting permission to use the map data, and for ensuring your use adheres to the relevant terms of use.
Installation
------------
There are three ways that you can install the SDK, depending upon your needs:
1. Clone from GitHub and integrate as a dependent Xcode project.
1. Use the [static library](http://mapbox-ios-sdk.s3.amazonaws.com/index.html). Link it in your project, add `#import <Mapbox/Mapbox.h>`, and additionally, include the `-ObjC` linker flag.
1. Install via [CocoaPods](http://cocoapods.org).
More detailed information on the installation options is available in the [SDK guide](http://mapbox.com/mapbox-ios-sdk-legacy/).
The two main branches of the GitHub repository are pretty self-explanatory: `release` and `develop`. When we tag a [release](https://github.com/mapbox/mapbox-ios-sdk-legacy/tags), we also merge `develop` over to `release`, except in the case of minor point releases (e.g., `0.4.2`), where we might just bring over a fix or two from `develop`.
Then, update the submodules:
git submodule update --init
Some example apps showing usage of the SDK (with screenshots):
* [Mapbox iOS Example](https://github.com/mapbox/mapbox-ios-example) - online, offline, and interactive tile sources
* [Mapbox iOS SDK Offline Example](https://github.com/mapbox/mapbox-ios-sdk-offline) - offline tile source, written in Swift
* [Mapbox Me](https://github.com/mapbox/mapbox-me) - user location services and terrain toggling
* [Weekend Picks](https://github.com/mapbox/weekend-picks-template-ios) - markers and data
More documentation and examples are available here: http://mapbox.com/mapbox-ios-sdk-legacy/
There are two subdirectories - MapView and Proj4. Proj4 is a support library used to do map projections. The MapView project contains only the Route-Me map library.
See License.txt for license details. In any app that uses this SDK, include the following text on your "preferences" or "about" screen: "Uses Mapbox iOS SDK, (c) 2008-2014 Mapbox and Route-Me Contributors". Your data provider will have additional attribution requirements.
News, Support and Contributing
------------------------------
Complete API documentation is available [online](http://mapbox.com/mapbox-ios-sdk-legacy/api/) or as an [Xcode docset Atom feed](http://mapbox.com/mapbox-ios-sdk-legacy/Docs/publish/docset.atom).
We have a [basic technical overview](http://mapbox.com/mapbox-ios-sdk-legacy/) along with the installation instructions.
Mapbox has an IRC channel on `irc.freenode.net` in `#mapbox`.
To report bugs and help fix them, please use the [issue tracker](https://github.com/mapbox/mapbox-ios-sdk-legacy/issues).
Dependent Libraries
-------------------
The Mapbox iOS SDK makes use of several sub-libraries, listed below. See License.txt for more detailed information about Route-Me and Proj4 and see the individual license files in the sub-libraries for more information on each.
* [FMDB](https://github.com/ccgus/fmdb) by Gus Mueller (SQLite for caching and MBTiles)
* [GRMustache](https://github.com/groue/GRMustache) by Gwendal Roué (Mustache templates)
* [SMCalloutView](https://github.com/nfarina/calloutview) by Nick Farina (annotation callouts)
... ...
Mapbox iOS SDK
--------------
Based on the Route-Me iOS map library (Alpstein fork) with [Mapbox](http://mapbox.com) customizations.
**This tree of the Mapbox iOS SDK is deprecated in favor of the [Mapbox GL](http://github.com/mapbox/mapbox-gl-native)-based version 2.0.0 and above. The future of Mapbox maps is vector rendering, and 2.0.0 is a rewrite based on OpenGL ES and vector rendering. Unlimited, per-user Mapbox pricing plans cannot be used with this version of the iOS SDK.**
Requires iOS 5 or greater (includes iOS 7+ support at runtime), Xcode 5.0 or greater, and ARC.
[![](https://raw.github.com/mapbox/mapbox-ios-sdk/packaging/screenshot.png)]()
Major differences from [Alpstein fork of Route-Me](https://github.com/Alpstein/route-me):
* Requires iOS 5.0 and above.
* Supports Automatic Reference Counting (ARC).
* [Mapbox](http://mapbox.com) & [MBTiles](http://mbtiles.org) tile source integration code.
* [Mapbox Markers](http://mapbox.com/blog/markers/) support.
* [UTFGrid interactivity](http://mapbox.com/mbtiles-spec/utfgrid/).
* Improved network tile loading performance.
* A bulk, background map tile downloader for cache pre-population and offline use.
* Annotation callouts that behave like MapKit.
* Annotation convenience subclasses for points and shapes.
* Prepackaged static library.
* [CocoaPods](http://cocoapods.org) support.
* Removal of two-finger double-tap gesture for zoom out (to speed up two-finger single-tap recognition like MapKit).
* Different default starting location for maps.
* Built-in attribution view controller with button on map views & default OpenStreetMap attribution.
* Easy static map view support.
* Removal of included example projects in favor of separate examples on GitHub.
* A few added defaults for convenience.
* Improved documentation.
Keep your eye also on [Mapbox GL](https://www.mapbox.com/blog/mapbox-gl/), the future of our rendering technology. We are aiming to have a clear upgrade path between existing toolsets and GL as it matures. Read more in the [Mapbox GL Cocoa FAQ](https://github.com/mapbox/mapbox-gl-cocoa/blob/master/FAQ.md).
Route-Me
--------
Route-Me is an open source map library that runs natively on iOS. It's designed to look and feel much like the built-in iOS map library, but it's entirely open, and works with any map source using a pluggable backend system.
Supported map tile sources include [Mapbox](http://mapbox.com/developers/api/)/[TileStream](https://github.com/mapbox/tilestream), the offline-capable, database-backed format [MBTiles](http://mbtiles.org), [OpenStreetMap](http://www.openstreetmap.org), and several others.
Please note that you are responsible for getting permission to use the map data, and for ensuring your use adheres to the relevant terms of use.
Installation
------------
There are three ways that you can install the SDK, depending upon your needs:
1. Clone from GitHub and integrate as a dependent Xcode project.
1. Use the [static library](http://mapbox-ios-sdk.s3.amazonaws.com/index.html). Link it in your project, add `#import <Mapbox/Mapbox.h>`, and additionally, include the `-ObjC` linker flag.
1. Install via [CocoaPods](http://cocoapods.org).
More detailed information on the installation options is available in the [SDK guide](http://mapbox.com/mapbox-ios-sdk/).
The two main branches of the GitHub repository are pretty self-explanatory: `release` and `develop`. When we tag a [release](https://github.com/mapbox/mapbox-ios-sdk/tags), we also merge `develop` over to `release`, except in the case of minor point releases (e.g., `0.4.2`), where we might just bring over a fix or two from `develop`.
Then, update the submodules:
git submodule update --init
Some example apps showing usage of the SDK (with screenshots):
* [Mapbox iOS Example](https://github.com/mapbox/mapbox-ios-example) - online, offline, and interactive tile sources
* [Mapbox Me](https://github.com/mapbox/mapbox-me) - user location services and terrain toggling
* [Weekend Picks](https://github.com/mapbox/weekend-picks-template-ios) - markers and data
More documentation is available:
http://mapbox.com/mapbox-ios-sdk/
There are two subdirectories - MapView and Proj4. Proj4 is a support library used to do map projections. The MapView project contains only the Route-Me map library.
See License.txt for license details. In any app that uses this SDK, include the following text on your "preferences" or "about" screen: "Uses Mapbox iOS SDK, (c) 2008-2014 Mapbox and Route-Me Contributors". Your data provider will have additional attribution requirements.
News, Support and Contributing
------------------------------
Complete API documentation is available [online](http://mapbox.com/mapbox-ios-sdk/api/) or as an [Xcode docset Atom feed](http://mapbox.com/mapbox-ios-sdk/Docs/publish/docset.atom).
The Mapbox iOS SDK has a [support resource](http://support.mapbox.com/discussions/mapbox-ios-sdk) where you can open cases and browse other developers' discussions about use of the SDK.
We have a [basic technical overview](http://mapbox.com/mapbox-ios-sdk/) along with the installation instructions.
Mapbox has an IRC channel on `irc.freenode.net` in `#mapbox`.
To report bugs and help fix them, please use the [issue tracker](https://github.com/mapbox/mapbox-ios-sdk/issues).
Dependent Libraries
-------------------
The Mapbox iOS SDK makes use of several sub-libraries, listed below. See License.txt for more detailed information about Route-Me and Proj4 and see the individual license files in the sub-libraries for more information on each.
* [FMDB](https://github.com/ccgus/fmdb) by Gus Mueller (SQLite for caching and MBTiles)
* [GRMustache](https://github.com/groue/GRMustache) by Gwendal Roué (Mustache templates)
* [SMCalloutView](https://github.com/nfarina/calloutview) by Nick Farina (annotation callouts)
See [this doc](README-old.markdown) for the original project details.
... ...