Authored by Justin R. Miller

add convenience method for MBTiles bundle resources

... ... @@ -50,6 +50,11 @@
/** @name Creating Tile Sources */
/** Initialize and return a newly allocated MBTiles tile source based on a given bundle resource.
* @param name The name of the resource file. If name is an empty string or `nil`, uses the first file encountered of the supplied type.
* @param extension If extension is an empty string or `nil`, the extension is assumed not to exist and the file is the first file encountered that exactly matches name. */
- (id)initWithTileSetResource:(NSString *)name ofType:(NSString *)extension;
/** Initialize and return a newly allocated MBTiles tile source based on a given local database URL.
* @param tileSetURL Local file path URL to an MBTiles file.
* @return An initialized MBTiles tile source. */
... ...
... ... @@ -46,6 +46,11 @@
@synthesize cacheable = _cacheable, opaque = _opaque;
- (id)initWithTileSetResource:(NSString *)name ofType:(NSString *)extension
{
return [self initWithTileSetURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:name ofType:extension]]];
}
- (id)initWithTileSetURL:(NSURL *)tileSetURL
{
if ( ! (self = [super init]))
... ...