diff --git a/MapView/Map/RMCompositeSource.h b/MapView/Map/RMCompositeSource.h deleted file mode 100644 index 0d5590174..000000000 --- a/MapView/Map/RMCompositeSource.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// RMCompositeSource.h -// MapView -// -// Created by Justin Miller on 4/19/12. -// Copyright (c) 2012 MapBox / Development Seed. All rights reserved. -// - -#import "RMTileSource.h" - -@interface RMCompositeSource : NSObject -{ - RMFractalTileProjection *tileProjection; -} - -@property (nonatomic, retain) NSMutableArray *compositeSources; - -- (id)initWithTileSource:(id )initialTileSource; - -- (UIImage *)imageForTile:(RMTile)tile inCache:(RMTileCache *)tileCache; -- (void)cancelAllDownloads; - -- (RMFractalTileProjection *)mercatorToTileProjection; -- (RMProjection *)projection; - -- (float)minZoom; -- (void)setMinZoom:(NSUInteger)aMinZoom; - -- (float)maxZoom; -- (void)setMaxZoom:(NSUInteger)aMaxZoom; - -- (int)tileSideLength; -- (void)setTileSideLength:(NSUInteger)aTileSideLength; - -- (RMSphericalTrapezium)latitudeLongitudeBoundingBox; - -- (NSString *)uniqueTilecacheKey; - -- (NSString *)shortName; -- (NSString *)longDescription; -- (NSString *)shortAttribution; -- (NSString *)longAttribution; - -- (void)didReceiveMemoryWarning; - -@end diff --git a/MapView/Map/RMCompositeSource.m b/MapView/Map/RMCompositeSource.m deleted file mode 100644 index 300989e2a..000000000 --- a/MapView/Map/RMCompositeSource.m +++ /dev/null @@ -1,156 +0,0 @@ -// -// RMCompositeSource.m -// MapView -// -// Created by Justin Miller on 4/19/12. -// Copyright (c) 2012 MapBox / Development Seed. All rights reserved. -// - -#import "RMCompositeSource.h" - -#import "RMAbstractMercatorTileSource.h" - -@implementation RMCompositeSource - -@synthesize compositeSources; - -- (id)initWithTileSource:(id )initialTileSource -{ - self = [super init]; - - if (self) - compositeSources = [[NSMutableArray arrayWithObject:initialTileSource] retain]; - - return self; -} - -- (void)dealloc -{ - [compositeSources release]; - - [super dealloc]; -} - -- (UIImage *)imageForTile:(RMTile)tile inCache:(RMTileCache *)tileCache -{ - // FIXME: cache - - UIImage *image = nil; - - for (id tileSource in self.compositeSources) - { - UIImage *sourceImage = [tileSource imageForTile:tile inCache:tileCache]; - - if (sourceImage) - { - if (image != nil) - { - UIGraphicsBeginImageContext(image.size); - - [image drawAtPoint:CGPointMake(0,0)]; - - [sourceImage drawAtPoint:CGPointMake(0,0)]; - - image = UIGraphicsGetImageFromCurrentImageContext(); - - UIGraphicsEndImageContext(); - } - else - { - image = sourceImage; - } - } - } - - return image; -} - -- (void)cancelAllDownloads -{ - NSLog(@"cancelAllDownloads"); -} - -- (RMFractalTileProjection *)mercatorToTileProjection -{ - if ( ! tileProjection) - { - tileProjection = [[RMFractalTileProjection alloc] initFromProjection:[self projection] - tileSideLength:[self tileSideLength] - maxZoom:[self maxZoom] - minZoom:[self minZoom]]; - } - - return tileProjection; -} - -- (RMProjection *)projection -{ - return [RMProjection googleProjection]; -} - -- (float)minZoom -{ - return kDefaultMinTileZoom; -} - -- (void)setMinZoom:(NSUInteger)aMinZoom -{ - NSLog(@"setMinZoom:"); -} - -- (float)maxZoom -{ - return kDefaultMaxTileZoom; -} - -- (void)setMaxZoom:(NSUInteger)aMaxZoom -{ - NSLog(@"setMaxZoom:"); -} - -- (int)tileSideLength -{ - return kDefaultTileSize; -} - -- (void)setTileSideLength:(NSUInteger)aTileSideLength -{ - NSLog(@"setTileSideLength:"); -} - -- (RMSphericalTrapezium)latitudeLongitudeBoundingBox -{ - return kDefaultLatLonBoundingBox; -} - -- (NSString *)uniqueTilecacheKey -{ - return NSStringFromClass([self class]); -} - -- (NSString *)shortName -{ - return @"shortName"; -} - -- (NSString *)longDescription -{ - return @"longDescription"; -} - -- (NSString *)shortAttribution -{ - return @"shortAttribution"; -} - -- (NSString *)longAttribution -{ - return @"longAttribution"; -} - -- (void)didReceiveMemoryWarning -{ - NSLog(@"didReceiveMemoryWarning"); -} - -@end diff --git a/MapView/Map/RMInteractiveSource.m b/MapView/Map/RMInteractiveSource.m index 6fbcf05b7..efeb74781 100644 --- a/MapView/Map/RMInteractiveSource.m +++ b/MapView/Map/RMInteractiveSource.m @@ -33,8 +33,6 @@ #import "RMInteractiveSource.h" -#import "RMCompositeSource.h" - #import "FMDatabase.h" #import "FMDatabaseQueue.h" @@ -73,29 +71,17 @@ @implementation RMMapView (RMInteractiveSource) { id interactiveTileSource = nil; - if ([self.tileSource isKindOfClass:[RMCompositeSource class]]) - { - // currently, we iterate top-down and return the first interactive source - // - for (id source in [[((RMCompositeSource *)self.tileSource).compositeSources reverseObjectEnumerator] allObjects]) - { - if (([source isKindOfClass:[RMMBTilesSource class]] || [source isKindOfClass:[RMMapBoxSource class]]) && - [source conformsToProtocol:@protocol(RMInteractiveSource)] && - [(id )source supportsInteractivity]) - { - interactiveTileSource = (id )source; - - break; - } - } - } - else + // currently, we iterate top-down and return the first interactive source + // + for (id source in [[self.tileSources reverseObjectEnumerator] allObjects]) { - if (([self.tileSource isKindOfClass:[RMMBTilesSource class]] || [self.tileSource isKindOfClass:[RMMapBoxSource class]]) && - [self.tileSource conformsToProtocol:@protocol(RMInteractiveSource)] && - [(id )self.tileSource supportsInteractivity]) + if (([source isKindOfClass:[RMMBTilesSource class]] || [source isKindOfClass:[RMMapBoxSource class]]) && + [source conformsToProtocol:@protocol(RMInteractiveSource)] && + [(id )source supportsInteractivity]) { - interactiveTileSource = (id )self.tileSource; + interactiveTileSource = (id )source; + + break; } } diff --git a/MapView/MapView.xcodeproj/project.pbxproj b/MapView/MapView.xcodeproj/project.pbxproj index 06a5bffda..ab778473b 100755 --- a/MapView/MapView.xcodeproj/project.pbxproj +++ b/MapView/MapView.xcodeproj/project.pbxproj @@ -144,8 +144,6 @@ B8F3FC650EA2E792004D8F85 /* RMMarker.m in Sources */ = {isa = PBXBuildFile; fileRef = B8F3FC630EA2E792004D8F85 /* RMMarker.m */; }; D1437B36122869E400888DAE /* RMDBMapSource.m in Sources */ = {isa = PBXBuildFile; fileRef = D1437B32122869E400888DAE /* RMDBMapSource.m */; }; D1437B37122869E400888DAE /* RMDBMapSource.h in Headers */ = {isa = PBXBuildFile; fileRef = D1437B33122869E400888DAE /* RMDBMapSource.h */; }; - DD103E241540E3CF00AA65DD /* RMCompositeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DD103E221540E3CF00AA65DD /* RMCompositeSource.h */; }; - DD103E251540E3CF00AA65DD /* RMCompositeSource.m in Sources */ = {isa = PBXBuildFile; fileRef = DD103E231540E3CF00AA65DD /* RMCompositeSource.m */; }; 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 */; }; @@ -325,8 +323,6 @@ B8F3FC630EA2E792004D8F85 /* RMMarker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMMarker.m; sourceTree = ""; }; D1437B32122869E400888DAE /* RMDBMapSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMDBMapSource.m; sourceTree = ""; }; D1437B33122869E400888DAE /* RMDBMapSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMDBMapSource.h; sourceTree = ""; }; - DD103E221540E3CF00AA65DD /* RMCompositeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMCompositeSource.h; sourceTree = ""; }; - DD103E231540E3CF00AA65DD /* RMCompositeSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMCompositeSource.m; sourceTree = ""; }; DD2B373F14CF8041008DE8CB /* FMDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMDatabase.h; sourceTree = ""; }; DD2B374014CF8041008DE8CB /* FMDatabase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMDatabase.m; sourceTree = ""; }; DD2B374114CF8041008DE8CB /* FMDatabaseAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMDatabaseAdditions.h; sourceTree = ""; }; @@ -441,8 +437,6 @@ DD2B375414CF8197008DE8CB /* RMMBTilesSource.m */, DD6380DB152E72880074E66E /* RMMapBoxSource.h */, DD6380DC152E72880074E66E /* RMMapBoxSource.m */, - DD103E221540E3CF00AA65DD /* RMCompositeSource.h */, - DD103E231540E3CF00AA65DD /* RMCompositeSource.m */, ); name = "Map sources"; sourceTree = ""; @@ -841,7 +835,6 @@ DDC4BEEB152E3DE700089409 /* GRMustacheTemplateRepository.h in Headers */, DDC4BEEC152E3DE700089409 /* GRMustacheVersion.h in Headers */, DD6380DD152E72880074E66E /* RMMapBoxSource.h in Headers */, - DD103E241540E3CF00AA65DD /* RMCompositeSource.h in Headers */, DD8FD7541559E4A40044D96F /* RMUserLocation.h in Headers */, DDA6B8BD155CAB67003DB5D8 /* RMUserTrackingBarButtonItem.h in Headers */, DD3BEF7915913C55007892D8 /* RMAttributionViewController.h in Headers */, @@ -1067,7 +1060,6 @@ 16FFF2CC14E3DBF700A170EC /* RMMapQuestOpenAerialSource.m in Sources */, DD6380DE152E72880074E66E /* RMMapBoxSource.m in Sources */, DDC4BEF2152E3FAE00089409 /* RMInteractiveSource.m in Sources */, - DD103E251540E3CF00AA65DD /* RMCompositeSource.m in Sources */, DD8FD7551559E4A40044D96F /* RMUserLocation.m in Sources */, DDA6B8BE155CAB67003DB5D8 /* RMUserTrackingBarButtonItem.m in Sources */, DD3BEF7A15913C55007892D8 /* RMAttributionViewController.m in Sources */,