Refactored a bit of code to help the cloudmate guys.
Showing
3 changed files
with
10 additions
and
9 deletions
@@ -26,7 +26,9 @@ | @@ -26,7 +26,9 @@ | ||
26 | bounds.origin.y = -20037508.34; | 26 | bounds.origin.y = -20037508.34; |
27 | bounds.size.width = 20037508.34 * 2; | 27 | bounds.size.width = 20037508.34 * 2; |
28 | bounds.size.height = 20037508.34 * 2; | 28 | bounds.size.height = 20037508.34 * 2; |
29 | - tileProjection = [[RMFractalTileProjection alloc] initWithBounds:bounds TileSideLength:256 MaxZoom:18]; | 29 | + |
30 | + int sideLength = [[self class] tileSideLength]; | ||
31 | + tileProjection = [[RMFractalTileProjection alloc] initWithBounds:bounds TileSideLength:sideLength MaxZoom:18]; | ||
30 | 32 | ||
31 | return self; | 33 | return self; |
32 | } | 34 | } |
@@ -37,6 +39,11 @@ | @@ -37,6 +39,11 @@ | ||
37 | [super dealloc]; | 39 | [super dealloc]; |
38 | } | 40 | } |
39 | 41 | ||
42 | ++(int)tileSideLength | ||
43 | +{ | ||
44 | + return 256; | ||
45 | +} | ||
46 | + | ||
40 | -(NSString*) tileURL: (RMTile) tile | 47 | -(NSString*) tileURL: (RMTile) tile |
41 | { | 48 | { |
42 | @throw [NSException exceptionWithName:@"RMAbstractMethodInvocation" reason:@"tileURL invoked on AbstractMercatorWebSource. Override this method when instantiating abstract class." userInfo:nil]; | 49 | @throw [NSException exceptionWithName:@"RMAbstractMethodInvocation" reason:@"tileURL invoked on AbstractMercatorWebSource. Override this method when instantiating abstract class." userInfo:nil]; |
@@ -46,7 +53,6 @@ | @@ -46,7 +53,6 @@ | ||
46 | { | 53 | { |
47 | tile = [tileProjection normaliseTile:tile]; | 54 | tile = [tileProjection normaliseTile:tile]; |
48 | RMTileImage* image = [RMTileImage imageWithTile: tile FromURL:[self tileURL:tile]]; | 55 | RMTileImage* image = [RMTileImage imageWithTile: tile FromURL:[self tileURL:tile]]; |
49 | - // [cache addTile:tile WithImage:image]; | ||
50 | return image; | 56 | return image; |
51 | } | 57 | } |
52 | 58 | ||
@@ -65,7 +71,5 @@ | @@ -65,7 +71,5 @@ | ||
65 | return [tileProjection bounds]; | 71 | return [tileProjection bounds]; |
66 | } | 72 | } |
67 | 73 | ||
68 | -//@synthesize cache; | ||
69 | - | ||
70 | @end | 74 | @end |
71 | 75 |
-
Please register or login to post a comment