Authored by Justin R. Miller

fixes #203: use local, offline-capable TileJSON by default

... ... @@ -52,7 +52,11 @@
- (id)init
{
return [self initWithMapID:([[UIScreen mainScreen] scale] > 1.0 ? kMapBoxPlaceholderRetinaMapID : kMapBoxPlaceholderNormalMapID)];
BOOL useRetina = ([[UIScreen mainScreen] scale] > 1.0);
NSString *localTileJSONPath = [RMMapView pathForBundleResourceNamed:(useRetina ? kMapBoxPlaceholderRetinaMapID : kMapBoxPlaceholderNormalMapID) ofType:@"json"];
return [self initWithReferenceURL:[NSURL fileURLWithPath:localTileJSONPath]];
}
- (id)initWithMapID:(NSString *)mapID
... ...
... ... @@ -138,7 +138,7 @@ typedef enum : NSUInteger {
/** @name Initializing a Map View */
/** Initialize a map view with a given frame. A default watermarked MapBox map layer will be used, which will require an internet connection. If your application will be operating offline from the start, you should create an offline tile source and instead use the initWithFrame:andTilesource: initializer. */
/** Initialize a map view with a given frame. A default watermarked MapBox map tile source will be used. */
- (id)initWithFrame:(CGRect)frame;
/** Initialize a map view with a given frame and tile source.
... ...
{"attribution":"<a href='http://mapbox.com/about/maps' target='_blank'>Terms & Feedback</a>","bounds":[-180,-85.0511,180,85.0511],"center":[0,0,3],"description":"","geocoder":"http://a.tiles.mapbox.com/v3/examples.map-z2effxa8/geocode/{query}.jsonp","id":"examples.map-z2effxa8","maxzoom":17,"minzoom":0,"name":"MapBox iOS Example","private":true,"scheme":"xyz","tilejson":"2.0.0","tiles":["http://a.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png","http://b.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png","http://c.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png","http://d.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png"],"webpage":"http://tiles.mapbox.com/examples/map/map-z2effxa8"}
\ No newline at end of file
... ...
{"attribution":"<a href='http://mapbox.com/about/maps' target='_blank'>Terms & Feedback</a>","bounds":[-180,-85.0511,180,85.0511],"center":[0,0,3],"description":"","geocoder":"http://a.tiles.mapbox.com/v3/examples.map-zswgei2n/geocode/{query}.jsonp","id":"examples.map-zswgei2n","maxzoom":17,"minzoom":0,"name":"MapBox iOS Example (Retina)","private":true,"scheme":"xyz","tilejson":"2.0.0","tiles":["http://a.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png","http://b.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png","http://c.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png","http://d.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png"],"webpage":"http://tiles.mapbox.com/examples/map/map-zswgei2n"}
\ No newline at end of file
... ...
... ... @@ -87,6 +87,8 @@
DD1985C2165C5F6400DF667F /* RMTileMillSource.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1985C0165C5F6400DF667F /* RMTileMillSource.m */; };
DD1E3C6E161F954F004FC649 /* SMCalloutView.h in Headers */ = {isa = PBXBuildFile; fileRef = DD1E3C6C161F954F004FC649 /* SMCalloutView.h */; };
DD1E3C6F161F954F004FC649 /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1E3C6D161F954F004FC649 /* SMCalloutView.m */; };
DD280D1416EFDDD30014B549 /* examples.map-z2effxa8.json in Resources */ = {isa = PBXBuildFile; fileRef = DD280D1216EFDDD30014B549 /* examples.map-z2effxa8.json */; };
DD280D1516EFDDD30014B549 /* examples.map-zswgei2n.json in Resources */ = {isa = PBXBuildFile; fileRef = DD280D1316EFDDD30014B549 /* examples.map-zswgei2n.json */; };
DD2B374514CF8041008DE8CB /* FMDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = DD2B373F14CF8041008DE8CB /* FMDatabase.h */; };
DD2B374614CF8041008DE8CB /* FMDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2B374014CF8041008DE8CB /* FMDatabase.m */; };
DD2B374714CF8041008DE8CB /* FMDatabaseAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DD2B374114CF8041008DE8CB /* FMDatabaseAdditions.h */; };
... ... @@ -245,6 +247,8 @@
DD1985C0165C5F6400DF667F /* RMTileMillSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMTileMillSource.m; sourceTree = "<group>"; };
DD1E3C6C161F954F004FC649 /* SMCalloutView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SMCalloutView.h; path = SMCalloutView/SMCalloutView.h; sourceTree = "<group>"; };
DD1E3C6D161F954F004FC649 /* SMCalloutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SMCalloutView.m; path = SMCalloutView/SMCalloutView.m; sourceTree = "<group>"; };
DD280D1216EFDDD30014B549 /* examples.map-z2effxa8.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "examples.map-z2effxa8.json"; path = "Map/Resources/examples.map-z2effxa8.json"; sourceTree = "<group>"; };
DD280D1316EFDDD30014B549 /* examples.map-zswgei2n.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "examples.map-zswgei2n.json"; path = "Map/Resources/examples.map-zswgei2n.json"; sourceTree = "<group>"; };
DD2B373F14CF8041008DE8CB /* FMDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMDatabase.h; sourceTree = "<group>"; };
DD2B374014CF8041008DE8CB /* FMDatabase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMDatabase.m; sourceTree = "<group>"; };
DD2B374114CF8041008DE8CB /* FMDatabaseAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMDatabaseAdditions.h; sourceTree = "<group>"; };
... ... @@ -611,6 +615,8 @@
DD932BB0165C287000D69D49 /* TrackingHeading@2x.png */,
DD932BB1165C287000D69D49 /* TrackingLocation.png */,
DD932BB2165C287000D69D49 /* TrackingLocation@2x.png */,
DD280D1216EFDDD30014B549 /* examples.map-z2effxa8.json */,
DD280D1316EFDDD30014B549 /* examples.map-zswgei2n.json */,
);
name = Resources;
path = ..;
... ... @@ -814,6 +820,8 @@
DD94D46B16C2E064003D5739 /* HeadingAngleLarge@2x.png in Resources */,
DD94D46C16C2E064003D5739 /* HeadingAngleMedium.png in Resources */,
DD94D46D16C2E064003D5739 /* HeadingAngleMedium@2x.png in Resources */,
DD280D1416EFDDD30014B549 /* examples.map-z2effxa8.json in Resources */,
DD280D1516EFDDD30014B549 /* examples.map-zswgei2n.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ...