Authored by Joseph G

Added cloudmade map source

  1 +//
  2 +// RMCloudMadeMapSource.h
  3 +// MapView
  4 +//
  5 +// Created by Dmytro Golub on 10/29/08.
  6 +// Copyright 2008 Cloudmade. Refer to project license.
  7 +//
  8 +
  9 +#import "RMAbstractMecatorWebSource.h"
  10 +
  11 +
  12 +@interface RMCloudMadeMapSource : RMAbstractMecatorWebSource <RMAbstractMecatorWebSource>
  13 +{
  14 +
  15 +}
  16 +
  17 ++(int)tileSideLength;
  18 +
  19 +@end
  1 +//
  2 +// RMCloudMadeMapSource.m
  3 +// MapView
  4 +//
  5 +// Created by Dmytro Golub on 10/29/08.
  6 +// Copyright 2008 Cloudmade. All rights reserved.
  7 +//
  8 +
  9 +#import "RMCloudMadeMapSource.h"
  10 +
  11 +
  12 +@implementation RMCloudMadeMapSource
  13 +
  14 +-(NSString*) tileURL: (RMTile) tile
  15 +{
  16 + return [NSString stringWithFormat:@"http://a.tile.cloudmade.com/0199bdee456e59ce950b0156029d6934/2/64/%d/%d/%d.png", tile.zoom, tile.x, tile.y];
  17 +}
  18 +
  19 +-(NSString*) description
  20 +{
  21 + return @"CloudMadeMaps";
  22 +}
  23 +
  24 ++(int)tileSideLength
  25 +{
  26 + return 64;
  27 +}
  28 +
  29 +@end
@@ -25,11 +25,14 @@ @@ -25,11 +25,14 @@
25 25
26 #import "RMMarker.h" 26 #import "RMMarker.h"
27 27
  28 +//#import "RMCloudMadeMapSource.h"
  29 +
28 @implementation RMMapContents 30 @implementation RMMapContents
29 31
30 #pragma mark Initialisation 32 #pragma mark Initialisation
31 - (id) initForView: (UIView*) view 33 - (id) initForView: (UIView*) view
32 { 34 {
  35 +// id<RMTileSource> _tileSource = [[RMCloudMadeMapSource alloc] init];
33 id<RMTileSource> _tileSource = [[RMOpenStreetMapsSource alloc] init]; 36 id<RMTileSource> _tileSource = [[RMOpenStreetMapsSource alloc] init];
34 RMMapRenderer *_renderer = [[RMCoreAnimationRenderer alloc] initWithContent:self]; 37 RMMapRenderer *_renderer = [[RMCoreAnimationRenderer alloc] initWithContent:self];
35 38
@@ -46,6 +46,8 @@ @@ -46,6 +46,8 @@
46 B8474C720EB53A41006A0BC1 /* marker-red-withletter.png in Resources */ = {isa = PBXBuildFile; fileRef = B8474C6E0EB53A41006A0BC1 /* marker-red-withletter.png */; }; 46 B8474C720EB53A41006A0BC1 /* marker-red-withletter.png in Resources */ = {isa = PBXBuildFile; fileRef = B8474C6E0EB53A41006A0BC1 /* marker-red-withletter.png */; };
47 B8474C730EB53A41006A0BC1 /* marker-red.png in Resources */ = {isa = PBXBuildFile; fileRef = B8474C6F0EB53A41006A0BC1 /* marker-red.png */; }; 47 B8474C730EB53A41006A0BC1 /* marker-red.png in Resources */ = {isa = PBXBuildFile; fileRef = B8474C6F0EB53A41006A0BC1 /* marker-red.png */; };
48 B8474C740EB53A41006A0BC1 /* marker-blue-withletter.png in Resources */ = {isa = PBXBuildFile; fileRef = B8474C700EB53A41006A0BC1 /* marker-blue-withletter.png */; }; 48 B8474C740EB53A41006A0BC1 /* marker-blue-withletter.png in Resources */ = {isa = PBXBuildFile; fileRef = B8474C700EB53A41006A0BC1 /* marker-blue-withletter.png */; };
  49 + B885ABB20EBB1332002206AB /* RMCloudMadeMapSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B885ABB00EBB1332002206AB /* RMCloudMadeMapSource.h */; };
  50 + B885ABB30EBB1332002206AB /* RMCloudMadeMapSource.m in Sources */ = {isa = PBXBuildFile; fileRef = B885ABB10EBB1332002206AB /* RMCloudMadeMapSource.m */; };
49 B8C974170E8A19B2007D16AD /* RMMercatorToScreenProjection.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64C80E80E73F001663B6 /* RMMercatorToScreenProjection.h */; }; 51 B8C974170E8A19B2007D16AD /* RMMercatorToScreenProjection.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64C80E80E73F001663B6 /* RMMercatorToScreenProjection.h */; };
50 B8C974190E8A19B2007D16AD /* RMMapRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64CA0E80E73F001663B6 /* RMMapRenderer.h */; }; 52 B8C974190E8A19B2007D16AD /* RMMapRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64CA0E80E73F001663B6 /* RMMapRenderer.h */; };
51 B8C9741D0E8A19B2007D16AD /* RMCoreAnimationRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64BD0E80E73F001663B6 /* RMCoreAnimationRenderer.h */; }; 53 B8C9741D0E8A19B2007D16AD /* RMCoreAnimationRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B83E64BD0E80E73F001663B6 /* RMCoreAnimationRenderer.h */; };
@@ -216,6 +218,8 @@ @@ -216,6 +218,8 @@
216 B8474C700EB53A41006A0BC1 /* marker-blue-withletter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "marker-blue-withletter.png"; sourceTree = "<group>"; }; 218 B8474C700EB53A41006A0BC1 /* marker-blue-withletter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "marker-blue-withletter.png"; sourceTree = "<group>"; };
217 B86F26AC0E87442C007A3773 /* RMMapLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapLayer.h; sourceTree = "<group>"; }; 219 B86F26AC0E87442C007A3773 /* RMMapLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapLayer.h; sourceTree = "<group>"; };
218 B86F26E10E877802007A3773 /* DesktopMapView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DesktopMapView-Info.plist"; sourceTree = "<group>"; }; 220 B86F26E10E877802007A3773 /* DesktopMapView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DesktopMapView-Info.plist"; sourceTree = "<group>"; };
  221 + B885ABB00EBB1332002206AB /* RMCloudMadeMapSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMCloudMadeMapSource.h; sourceTree = "<group>"; };
  222 + B885ABB10EBB1332002206AB /* RMCloudMadeMapSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMCloudMadeMapSource.m; sourceTree = "<group>"; };
219 B8C9740E0E8A198F007D16AD /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; }; 223 B8C9740E0E8A198F007D16AD /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
220 B8C974590E8A19B2007D16AD /* libMapView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMapView.a; sourceTree = BUILT_PRODUCTS_DIR; }; 224 B8C974590E8A19B2007D16AD /* libMapView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMapView.a; sourceTree = BUILT_PRODUCTS_DIR; };
221 B8C974690E8A1A50007D16AD /* RMMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapView.h; sourceTree = "<group>"; }; 225 B8C974690E8A1A50007D16AD /* RMMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapView.h; sourceTree = "<group>"; };
@@ -429,6 +433,8 @@ @@ -429,6 +433,8 @@
429 B83E64EE0E80E73F001663B6 /* RMOpenStreetMapsSource.m */, 433 B83E64EE0E80E73F001663B6 /* RMOpenStreetMapsSource.m */,
430 C7A9675C0E84134B0031BA75 /* RMVirtualEarthSource.h */, 434 C7A9675C0E84134B0031BA75 /* RMVirtualEarthSource.h */,
431 C7A9675D0E84134B0031BA75 /* RMVirtualEarthSource.m */, 435 C7A9675D0E84134B0031BA75 /* RMVirtualEarthSource.m */,
  436 + B885ABB00EBB1332002206AB /* RMCloudMadeMapSource.h */,
  437 + B885ABB10EBB1332002206AB /* RMCloudMadeMapSource.m */,
432 ); 438 );
433 name = "Tile Source"; 439 name = "Tile Source";
434 sourceTree = "<group>"; 440 sourceTree = "<group>";
@@ -595,6 +601,7 @@ @@ -595,6 +601,7 @@
595 1296F56D0EB8849B00FF25E0 /* RMMarkerStyles.h in Headers */, 601 1296F56D0EB8849B00FF25E0 /* RMMarkerStyles.h in Headers */,
596 23A0AAEB0EB90AA6003A4521 /* RMFoundation.h in Headers */, 602 23A0AAEB0EB90AA6003A4521 /* RMFoundation.h in Headers */,
597 23A0ABAA0EB923AF003A4521 /* RMLatLong.h in Headers */, 603 23A0ABAA0EB923AF003A4521 /* RMLatLong.h in Headers */,
  604 + B885ABB20EBB1332002206AB /* RMCloudMadeMapSource.h in Headers */,
598 ); 605 );
599 runOnlyForDeploymentPostprocessing = 0; 606 runOnlyForDeploymentPostprocessing = 0;
600 }; 607 };
@@ -742,6 +749,7 @@ @@ -742,6 +749,7 @@
742 1296F56C0EB8849B00FF25E0 /* RMMarkerStyle.m in Sources */, 749 1296F56C0EB8849B00FF25E0 /* RMMarkerStyle.m in Sources */,
743 1296F56E0EB8849C00FF25E0 /* RMMarkerStyles.m in Sources */, 750 1296F56E0EB8849C00FF25E0 /* RMMarkerStyles.m in Sources */,
744 23A0AAE90EB90A99003A4521 /* RMFoundation.c in Sources */, 751 23A0AAE90EB90A99003A4521 /* RMFoundation.c in Sources */,
  752 + B885ABB30EBB1332002206AB /* RMCloudMadeMapSource.m in Sources */,
745 ); 753 );
746 runOnlyForDeploymentPostprocessing = 0; 754 runOnlyForDeploymentPostprocessing = 0;
747 }; 755 };