Authored by Joseph G

Removed disk cache (it wasn't functional and even if implmented would be inferior to db-cache).

Also cleaned up some warnings, etc.
#include <unistd.h>
#import <Foundation/Foundation.h>
#import "FMResultSet.h"
#import "FMDatabase.h"
... ...
//
// FileCache.h
// Images
//
// Created by Joseph Gentle on 31/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "RMTileCache.h"
@interface RMDiskCache : NSObject<RMTileCache>
{
}
@end
//
// FileCache.m
// Images
//
// Created by Joseph Gentle on 31/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "RMDiskCache.h"
@implementation RMDiskCache
-(RMTileImage*) cachedImage:(RMTile)tile
{
return nil;
}
-(void)addTile: (RMTile)tile WithImage: (RMTileImage*)image
{
}
@end
... ... @@ -33,6 +33,8 @@
- (void)moveBy: (CGSize) delta;
- (void)zoomByFactor: (float) zoomFactor near:(CGPoint) center;
- (void) correctPositionOfAllSublayers;
//-(void) drawRect: (CGRect)rect;
//-(CALayer*) layer;
... ...
... ... @@ -18,6 +18,7 @@
@class RMTileLoader;
@class RMMapRenderer;
@class RMMapLayer;
@class RMLayerSet;
@class RMMarker;
@protocol RMMercatorToTileProjection;
@protocol RMTileSource;
... ... @@ -30,7 +31,7 @@
CALayer *layer;
RMMapLayer *background;
RMMapLayer *overlay;
RMLayerSet *overlay;
// Latlong is calculated dynamically from mercatorBounds.
RMProjection *projection;
... ... @@ -67,7 +68,7 @@
@property (readonly) CALayer *layer;
@property (retain, readwrite) RMMapLayer *background;
@property (retain, readwrite) RMMapLayer *overlay;
@property (retain, readwrite) RMLayerSet *overlay;
- (id) initForView: (UIView*) view;
... ...
... ... @@ -83,7 +83,7 @@
[self setBackground:theBackground];
[theBackground release];
RMMapLayer *theOverlay = [[RMLayerSet alloc] initForContents:self];
RMLayerSet *theOverlay = [[RMLayerSet alloc] initForContents:self];
[self setOverlay:theOverlay];
[theOverlay release];
... ... @@ -220,7 +220,7 @@
return [[background retain] autorelease];
}
- (void) setOverlay: (RMMapLayer*) aLayer
- (void) setOverlay: (RMLayerSet*) aLayer
{
if (overlay != nil)
{
... ... @@ -248,7 +248,7 @@
[overlay addSublayer:testLayer];*/
}
- (RMMapLayer *)overlay
- (RMLayerSet *)overlay
{
return [[overlay retain] autorelease];
}
... ...
... ... @@ -9,7 +9,6 @@
#import "RMTileCache.h"
#import "RMMemoryCache.h"
#import "RMDiskCache.h"
#import "RMDatabaseCache.h"
#import "RMConfiguration.h"
... ... @@ -31,7 +30,6 @@ static RMTileCache *cache = nil;
{
cacheCfg = [NSArray arrayWithObjects:
[NSDictionary dictionaryWithObject: @"memory-cache" forKey: @"type"],
[NSDictionary dictionaryWithObject: @"disk-cache" forKey: @"type"],
[NSDictionary dictionaryWithObject: @"db-cache" forKey: @"type"],
nil
];
... ... @@ -50,13 +48,7 @@ static RMTileCache *cache = nil;
if (capacity == nil) capacity = [NSNumber numberWithInt: 32];
newCache = [[RMMemoryCache alloc] initWithCapacity: [capacity intValue]];
}
if ([@"disk-cache" isEqualToString: type])
{
NSLog(@"creating disk cache");
newCache = [[RMDiskCache alloc] init];
}
if ([@"db-cache" isEqualToString: type])
{
newCache = [[RMDatabaseCache alloc] init];
... ...
... ... @@ -49,7 +49,6 @@
B8C974170E8A19B2007D16AD /* RMMercatorToScreenProjection.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64C80E80E73F001663B6 /* RMMercatorToScreenProjection.h */; };
B8C974190E8A19B2007D16AD /* RMMapRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64CA0E80E73F001663B6 /* RMMapRenderer.h */; };
B8C9741D0E8A19B2007D16AD /* RMCoreAnimationRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64BD0E80E73F001663B6 /* RMCoreAnimationRenderer.h */; };
B8C974200E8A19B2007D16AD /* RMDiskCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64D40E80E73F001663B6 /* RMDiskCache.h */; };
B8C974220E8A19B2007D16AD /* RMProjection.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64E30E80E73F001663B6 /* RMProjection.h */; };
B8C974230E8A19B2007D16AD /* RMTileCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64D00E80E73F001663B6 /* RMTileCache.h */; };
B8C974250E8A19B2007D16AD /* RMOpenStreetMapsSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64ED0E80E73F001663B6 /* RMOpenStreetMapsSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
... ... @@ -71,7 +70,6 @@
B8C974430E8A19B2007D16AD /* RMPixel.c in Sources */ = {isa = PBXBuildFile; fileRef = B83E64B70E80E73F001663B6 /* RMPixel.c */; };
B8C974440E8A19B2007D16AD /* RMFractalTileProjection.m in Sources */ = {isa = PBXBuildFile; fileRef = B83E64EA0E80E73F001663B6 /* RMFractalTileProjection.m */; };
B8C974460E8A19B2007D16AD /* RMFileTileImage.m in Sources */ = {isa = PBXBuildFile; fileRef = B83E64DF0E80E73F001663B6 /* RMFileTileImage.m */; };
B8C974470E8A19B2007D16AD /* RMDiskCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B83E64D50E80E73F001663B6 /* RMDiskCache.m */; };
B8C974480E8A19B2007D16AD /* RMTileCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B83E64D10E80E73F001663B6 /* RMTileCache.m */; };
B8C9744A0E8A19B2007D16AD /* RMProjection.m in Sources */ = {isa = PBXBuildFile; fileRef = B83E64E40E80E73F001663B6 /* RMProjection.m */; };
B8C9744C0E8A19B2007D16AD /* RMAbstractMecatorWebSource.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A967510E8412930031BA75 /* RMAbstractMecatorWebSource.m */; };
... ... @@ -171,8 +169,6 @@
B83E64D10E80E73F001663B6 /* RMTileCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMTileCache.m; sourceTree = "<group>"; };
B83E64D20E80E73F001663B6 /* RMMemoryCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMemoryCache.h; sourceTree = "<group>"; };
B83E64D30E80E73F001663B6 /* RMMemoryCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMMemoryCache.m; sourceTree = "<group>"; };
B83E64D40E80E73F001663B6 /* RMDiskCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMDiskCache.h; sourceTree = "<group>"; };
B83E64D50E80E73F001663B6 /* RMDiskCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMDiskCache.m; sourceTree = "<group>"; };
B83E64D60E80E73F001663B6 /* RMTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMTile.h; sourceTree = "<group>"; };
B83E64D70E80E73F001663B6 /* RMTile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = RMTile.c; sourceTree = "<group>"; };
B83E64D80E80E73F001663B6 /* RMTileImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMTileImage.h; sourceTree = "<group>"; };
... ... @@ -403,8 +399,6 @@
B83E64D10E80E73F001663B6 /* RMTileCache.m */,
B83E64D20E80E73F001663B6 /* RMMemoryCache.h */,
B83E64D30E80E73F001663B6 /* RMMemoryCache.m */,
B83E64D40E80E73F001663B6 /* RMDiskCache.h */,
B83E64D50E80E73F001663B6 /* RMDiskCache.m */,
B8C974C80E8A9C30007D16AD /* RMCachedTileSource.h */,
B8C974C90E8A9C30007D16AD /* RMCachedTileSource.m */,
B8474B940EB40094006A0BC1 /* Database */,
... ... @@ -568,7 +562,6 @@
B8C974170E8A19B2007D16AD /* RMMercatorToScreenProjection.h in Headers */,
B8C974190E8A19B2007D16AD /* RMMapRenderer.h in Headers */,
B8C9741D0E8A19B2007D16AD /* RMCoreAnimationRenderer.h in Headers */,
B8C974200E8A19B2007D16AD /* RMDiskCache.h in Headers */,
B8C974220E8A19B2007D16AD /* RMProjection.h in Headers */,
B8C974230E8A19B2007D16AD /* RMTileCache.h in Headers */,
B8C974250E8A19B2007D16AD /* RMOpenStreetMapsSource.h in Headers */,
... ... @@ -724,7 +717,6 @@
B8C974430E8A19B2007D16AD /* RMPixel.c in Sources */,
B8C974440E8A19B2007D16AD /* RMFractalTileProjection.m in Sources */,
B8C974460E8A19B2007D16AD /* RMFileTileImage.m in Sources */,
B8C974470E8A19B2007D16AD /* RMDiskCache.m in Sources */,
B8C974480E8A19B2007D16AD /* RMTileCache.m in Sources */,
B8C9744A0E8A19B2007D16AD /* RMProjection.m in Sources */,
B8C9744C0E8A19B2007D16AD /* RMAbstractMecatorWebSource.m in Sources */,
... ...