Permalink
Browse files

Committer: Malcolm Toon <mtoon@Malcolm-Toons-MacBook-Pro.local>

 On branch master
 Changes to be committed:
	new file:   RMMultiMBTilesTileSource.h
	new file:   RMMultiMBTilesTileSource.m

Allows multiple mbtiles datasources to be merged into a single tilesource.
  • Loading branch information...
1 parent 4ada294 commit 403949d4a72bd10436cd8a5012ec0debae1e8952 Malcolm Toon committed May 27, 2011
Showing with 467 additions and 0 deletions.
  1. +70 −0 MapView/Map/RMMultiMBTilesTileSource.h
  2. +397 −0 MapView/Map/RMMultiMBTilesTileSource.m
@@ -0,0 +1,70 @@
+//
+// RMMultiMBTilesTileSource.h
+//
+//
+// Created by Malcolm Toon on 5/21/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "RMTileSource.h"
+
+@class RMFractalTileProjection;
+@class FMDatabase;
+
+#define kMBTilesDefaultTileSize 256
+#define kMBTilesDefaultMinTileZoom 0
+#define kMBTilesDefaultMaxTileZoom 18
+#define kMBTilesDefaultLatLonBoundingBox ((RMSphericalTrapezium){ .northeast = { .latitude = 90, .longitude = 180 }, \
+.southwest = { .latitude = -90, .longitude = -180 } })
+
+
+@interface RMMultiMBTilesTileSource : NSObject <RMTileSource> {
+ RMFractalTileProjection *tileProjection;
+ NSMutableDictionary *dbDictionary;
+ float _minZoom;
+ float _maxZoom;
+ NSString *_cacheName;
+ NSMutableArray *databaseNames;
+
+ NSString *shortName;
+ NSString *longDescription;
+ NSString *shortAttribution;
+ NSString *longAttribution;
+ bool hasBaseLayer;
+ NSString *baseLayerName;
+}
+
+@property (copy, nonatomic) NSString *baseLayerName;
+@property (copy, nonatomic) NSString *shortName;
+@property (copy, nonatomic) NSString *longDescription;
+@property (copy, nonatomic) NSString *shortAttribution;
+@property (copy, nonatomic) NSString *longAttribution;
+
+
+
+-(id)initWithArray:(NSArray *)fileArray cacheName:(NSString *)cacheName;
+-(void)closeAllDatabases;
+-(void)addDatabase:(NSString *)databaseFilename;
+-(RMTileImage *)getTileImageFrom:(FMDatabase *)db atZoom:(int)zoom atCol:(int)col atRow:(int)row aTile:(RMTile)tile;
+-(void)setBaseLayer:(NSString *)databaseFilename;
+-(void)setReverseTiles:(NSString *)databaseFilename;
+
+- (int)tileSideLength;
+- (void)setTileSideLength:(NSUInteger)aTileSideLength;
+- (RMTileImage *)tileImage:(RMTile)tile;
+- (NSString *)tileURL:(RMTile)tile;
+- (NSString *)tileFile:(RMTile)tile;
+- (NSString *)tilePath;
+- (id <RMMercatorToTileProjection>)mercatorToTileProjection;
+- (RMProjection *)projection;
+- (float)minZoom;
+- (float)maxZoom;
+- (void)setMinZoom:(NSUInteger)aMinZoom;
+- (void)setMaxZoom:(NSUInteger)aMaxZoom;
+- (RMSphericalTrapezium)latitudeLongitudeBoundingBox;
+- (void)didReceiveMemoryWarning;
+- (NSString *)uniqueTilecacheKey;
+- (void)removeAllCachedImages;
+
+@end
Oops, something went wrong.

0 comments on commit 403949d

Please sign in to comment.