Authored by Justin R. Miller

Merge branch 'develop' into release

... ... @@ -58,10 +58,6 @@
- (id)initWithReferenceURL:(NSURL *)referenceURL; // Designated initializer. Point to either a remote TileJSON spec or a local TileJSON or property list.
//
// You may also use just `init` to get MapBox Streets by default.
//
- (id)initWithTileJSON:(NSString *)tileJSON; // Initialize source with TileJSON.
- (id)initWithInfo:(NSDictionary *)info; // Initialize source with properly list (deprecated).
... ...
... ... @@ -45,11 +45,6 @@
@synthesize infoDictionary;
- (id)init
{
return [self initWithReferenceURL:[NSURL URLWithString:@"http://api.tiles.mapbox.com/v2/mapbox.mapbox-streets.json"]];
}
- (id)initWithTileJSON:(NSString *)tileJSON
{
if (self = [super init])
... ... @@ -80,6 +75,12 @@
{
id dataObject;
if ([[referenceURL pathExtension] isEqualToString:@"jsonp"])
referenceURL = [NSURL URLWithString:[[referenceURL absoluteString] stringByReplacingOccurrencesOfString:@".jsonp"
withString:@".json"
options:NSAnchoredSearch & NSBackwardsSearch
range:NSMakeRange(0, [[referenceURL absoluteString] length])]];
if ((dataObject = [NSString stringWithContentsOfURL:referenceURL encoding:NSUTF8StringEncoding error:nil]) && dataObject)
return [self initWithTileJSON:dataObject];
... ...