|
@@ -45,11 +45,6 @@ |
|
@@ -45,11 +45,6 @@ |
45
|
|
45
|
|
46
|
@synthesize infoDictionary;
|
46
|
@synthesize infoDictionary;
|
47
|
|
47
|
|
48
|
-- (id)init
|
|
|
49
|
-{
|
|
|
50
|
- return [self initWithReferenceURL:[NSURL URLWithString:@"http://api.tiles.mapbox.com/v2/mapbox.mapbox-streets.json"]];
|
|
|
51
|
-}
|
|
|
52
|
-
|
|
|
53
|
- (id)initWithTileJSON:(NSString *)tileJSON
|
48
|
- (id)initWithTileJSON:(NSString *)tileJSON
|
54
|
{
|
49
|
{
|
55
|
if (self = [super init])
|
50
|
if (self = [super init])
|
|
@@ -80,6 +75,12 @@ |
|
@@ -80,6 +75,12 @@ |
80
|
{
|
75
|
{
|
81
|
id dataObject;
|
76
|
id dataObject;
|
82
|
|
77
|
|
|
|
78
|
+ if ([[referenceURL pathExtension] isEqualToString:@"jsonp"])
|
|
|
79
|
+ referenceURL = [NSURL URLWithString:[[referenceURL absoluteString] stringByReplacingOccurrencesOfString:@".jsonp"
|
|
|
80
|
+ withString:@".json"
|
|
|
81
|
+ options:NSAnchoredSearch & NSBackwardsSearch
|
|
|
82
|
+ range:NSMakeRange(0, [[referenceURL absoluteString] length])]];
|
|
|
83
|
+
|
83
|
if ((dataObject = [NSString stringWithContentsOfURL:referenceURL encoding:NSUTF8StringEncoding error:nil]) && dataObject)
|
84
|
if ((dataObject = [NSString stringWithContentsOfURL:referenceURL encoding:NSUTF8StringEncoding error:nil]) && dataObject)
|
84
|
return [self initWithTileJSON:dataObject];
|
85
|
return [self initWithTileJSON:dataObject];
|
85
|
|
86
|
|