Authored by Hal Mueller

added some dummy buttons, and one non-failing test, to MapTestbed

... ... @@ -47,4 +47,9 @@
@property(nonatomic,retain) IBOutlet UILabel *rmscale;
@property(nonatomic,retain) IBOutlet UILabel *truescale;
- (IBAction)useOpenStreetMap;
- (IBAction)useCloudMadeMap;
- (IBAction)useCloudMadeLowResMap;
- (IBAction)useMicrosoftVirtualEarthMap;
@end
... ...
... ... @@ -29,7 +29,7 @@
//
#import "FlipsideViewController.h"
#import "MapSampleAppDelegate.h"
#import "MapTestbedAppDelegate.h"
#import "MyMapView.h"
@implementation FlipsideViewController
... ... @@ -73,8 +73,7 @@
}
- (void)viewDidAppear:(BOOL)animated {
NSLog(@"viewDidAppear");
RMMapContents *contents = [(MapSampleAppDelegate *)[[UIApplication sharedApplication] delegate] mapContents];
RMMapContents *contents = [(MapTestbedAppDelegate *)[[UIApplication sharedApplication] delegate] mapContents];
CLLocationCoordinate2D mapCenter = [contents mapCenter];
[centerLat setText:[NSString stringWithFormat:@"%f", mapCenter.latitude]];
[centerLon setText:[NSString stringWithFormat:@"%f", mapCenter.longitude]];
... ... @@ -96,5 +95,21 @@
[super dealloc];
}
- (IBAction)useOpenStreetMap {
NSLog(@"useOpenStreetMap");
}
- (IBAction)useCloudMadeMap {
NSLog(@"useCloudMadeMap");
}
- (IBAction)useCloudMadeLowResMap {
NSLog(@"useCloudMadeLowResMap");
}
- (IBAction)useMicrosoftVirtualEarthMap {
NSLog(@"useMicrosoftVirtualEarthMap");
}
@end
... ...
... ... @@ -29,9 +29,10 @@
//
#import <UIKit/UIKit.h>
#import "RMMapView.h"
@interface MainViewController : UIViewController {
RMMapView *testMapview;
}
@end
... ...
... ... @@ -29,7 +29,7 @@
//
#import "MainViewController.h"
#import "MapSampleAppDelegate.h"
#import "MapTestbedAppDelegate.h"
#import "MyMapView.h"
@implementation MainViewController
... ... @@ -42,12 +42,23 @@
return self;
}
// from issue 21
- (void) refreshMap {
[testMapview removeFromSuperview];
[testMapview release];
testMapview = nil;
testMapview = [[RMMapView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:testMapview];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
[(MapSampleAppDelegate *)[[UIApplication sharedApplication] delegate] setMapContents:[(MyMapView *)[self view] contents]];
[(MapTestbedAppDelegate *)[[UIApplication sharedApplication] delegate] setMapContents:[(MyMapView *)[self view] contents]];
[NSTimer scheduledTimerWithTimeInterval:0.25 target:self
selector:@selector(refreshMap) userInfo:nil repeats:YES];
}
... ...
//
// MapSampleAppDelegate.h
// MapTestbedAppDelegate.h
// MapTestbed
//
// Created by Hal Mueller on 3/9/09.
... ... @@ -33,7 +33,7 @@
@class RootViewController;
@interface MapSampleAppDelegate : NSObject <UIApplicationDelegate> {
@interface MapTestbedAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
RootViewController *rootViewController;
RMMapContents *mapContents;
... ...
//
// MapSampleAppDelegate.m
// MapTestbedAppDelegate.m
// MapTestbed
//
// Created by Hal Mueller on 3/9/09.
... ... @@ -28,10 +28,10 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#import "MapSampleAppDelegate.h"
#import "MapTestbedAppDelegate.h"
#import "RootViewController.h"
@implementation MapSampleAppDelegate
@implementation MapTestbedAppDelegate
@synthesize window;
... ...
... ... @@ -184,6 +184,94 @@
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">1.000000e+01</float>
</object>
<object class="IBUIButton" id="832210644">
<reference key="NSNextResponder" ref="249263867"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 403}, {59, 37}}</string>
<reference key="NSSuperview" ref="249263867"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSFont" key="IBUIFont" id="376352188">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">1.500000e+01</double>
<int key="NSfFlags">16</int>
</object>
<int key="IBUIButtonType">1</int>
<string key="IBUIHighlightedTitle">OSM</string>
<string key="IBUIDisabledTitle">OSM</string>
<string key="IBUISelectedTitle">OSM</string>
<string key="IBUINormalTitle">OSM</string>
<reference key="IBUIHighlightedTitleColor" ref="872501489"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
</object>
<object class="IBUIButton" id="379769164">
<reference key="NSNextResponder" ref="249263867"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{155, 403}, {70, 37}}</string>
<reference key="NSSuperview" ref="249263867"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="376352188"/>
<int key="IBUIButtonType">1</int>
<string key="IBUIHighlightedTitle">CM lo</string>
<string key="IBUIDisabledTitle">CM lo</string>
<string key="IBUISelectedTitle">CM lo</string>
<string key="IBUINormalTitle">CM lo</string>
<reference key="IBUIHighlightedTitleColor" ref="872501489"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
</object>
<object class="IBUIButton" id="46576523">
<reference key="NSNextResponder" ref="249263867"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{88, 403}, {59, 37}}</string>
<reference key="NSSuperview" ref="249263867"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="376352188"/>
<int key="IBUIButtonType">1</int>
<string key="IBUIHighlightedTitle">CM</string>
<string key="IBUIDisabledTitle">CM</string>
<string key="IBUISelectedTitle">CM</string>
<string key="IBUINormalTitle">CM</string>
<reference key="IBUIHighlightedTitleColor" ref="872501489"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
</object>
<object class="IBUIButton" id="2378880">
<reference key="NSNextResponder" ref="249263867"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{233, 403}, {71, 37}}</string>
<reference key="NSSuperview" ref="249263867"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="376352188"/>
<int key="IBUIButtonType">1</int>
<string key="IBUIHighlightedTitle">MS VE</string>
<string key="IBUIDisabledTitle">MS VE</string>
<string key="IBUISelectedTitle">MS VE</string>
<string key="IBUINormalTitle">MS VE</string>
<reference key="IBUIHighlightedTitleColor" ref="872501489"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
... ... @@ -251,6 +339,42 @@
</object>
<int key="connectionID">57</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">useCloudMadeMap</string>
<reference key="source" ref="46576523"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">64</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">useCloudMadeLowResMap</string>
<reference key="source" ref="379769164"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">65</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">useMicrosoftVirtualEarthMap</string>
<reference key="source" ref="2378880"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">66</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">useOpenStreetMap</string>
<reference key="source" ref="832210644"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">67</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
... ... @@ -289,6 +413,10 @@
<reference ref="971773762"/>
<reference ref="1055911682"/>
<reference ref="916698432"/>
<reference ref="2378880"/>
<reference ref="832210644"/>
<reference ref="46576523"/>
<reference ref="379769164"/>
</object>
<reference key="parent" ref="360949347"/>
</object>
... ... @@ -342,6 +470,26 @@
<reference key="object" ref="916698432"/>
<reference key="parent" ref="249263867"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">58</int>
<reference key="object" ref="832210644"/>
<reference key="parent" ref="249263867"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">59</int>
<reference key="object" ref="379769164"/>
<reference key="parent" ref="249263867"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">60</int>
<reference key="object" ref="2378880"/>
<reference key="parent" ref="249263867"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">61</int>
<reference key="object" ref="46576523"/>
<reference key="parent" ref="249263867"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
... ... @@ -363,6 +511,10 @@
<string>54.IBPluginDependency</string>
<string>55.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>58.IBPluginDependency</string>
<string>59.IBPluginDependency</string>
<string>60.IBPluginDependency</string>
<string>61.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
... ... @@ -381,6 +533,10 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
... ... @@ -403,7 +559,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">57</int>
<int key="maxID">67</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
... ... @@ -419,6 +575,23 @@
<object class="IBPartialClassDescription">
<string key="className">FlipsideViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>useCloudMadeLowResMap</string>
<string>useCloudMadeMap</string>
<string>useMicrosoftVirtualEarthMap</string>
<string>useOpenStreetMap</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
... ... @@ -446,7 +619,7 @@
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.LastKnownRelativeProjectPath">TwoMapSample.xcodeproj</string>
<string key="IBDocument.LastKnownRelativeProjectPath">MapTestbed.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
... ...
... ... @@ -8,7 +8,6 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="18"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
... ... @@ -47,7 +46,7 @@
</object>
<object class="IBUIViewController" id="636070164">
<object class="IBUIView" key="IBUIView" id="282269593">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
... ... @@ -78,7 +77,6 @@
</object>
</object>
<string key="NSFrame">{{0, -16}, {320, 492}}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
... ... @@ -230,7 +228,7 @@
</object>
<string>{{391, 376}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>MapSampleAppDelegate</string>
<string>MapTestbedAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>RootViewController</string>
<string>{{391, 356}, {320, 480}}</string>
... ... @@ -263,7 +261,7 @@
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">MapSampleAppDelegate</string>
<string key="className">MapTestbedAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
... ... @@ -279,14 +277,6 @@
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/MapSampleAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">MapSampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
... ...
... ... @@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* MapSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* MapSampleAppDelegate.m */; };
1D3623260D0F684500981E51 /* MapTestbedAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* MapTestbedAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
... ... @@ -52,8 +52,8 @@
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* MapSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapSampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* MapSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapSampleAppDelegate.m; sourceTree = "<group>"; };
1D3623240D0F684500981E51 /* MapTestbedAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapTestbedAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* MapTestbedAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapTestbedAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* MapTestbed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MapTestbed.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
280E754A0DD40C5E005A515E /* FlipsideView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FlipsideView.xib; sourceTree = "<group>"; };
... ... @@ -75,7 +75,7 @@
2B0C07410F65F1FD00214CE8 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
2B0C07450F65F20700214CE8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
2B0C07490F65F23A00214CE8 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
32CA4F630368D1EE00C91783 /* MapTestbed_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MapTestbed_Prefix.pch; path = MapSample_Prefix.pch; sourceTree = "<group>"; };
2BD68E7A0F664657006DE17B /* MapTestbed_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapTestbed_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
... ... @@ -102,8 +102,8 @@
children = (
289233AA0DB2D0DB0083E9F9 /* RootViewController.h */,
289233AB0DB2D0DB0083E9F9 /* RootViewController.m */,
1D3623240D0F684500981E51 /* MapSampleAppDelegate.h */,
1D3623250D0F684500981E51 /* MapSampleAppDelegate.m */,
1D3623240D0F684500981E51 /* MapTestbedAppDelegate.h */,
1D3623250D0F684500981E51 /* MapTestbedAppDelegate.m */,
);
name = "Application Controllers";
path = Classes;
... ... @@ -160,7 +160,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* MapTestbed_Prefix.pch */,
2BD68E7A0F664657006DE17B /* MapTestbed_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
... ... @@ -283,7 +283,7 @@
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* MapSampleAppDelegate.m in Sources */,
1D3623260D0F684500981E51 /* MapTestbedAppDelegate.m in Sources */,
289233A60DB2D0840083E9F9 /* FlipsideView.m in Sources */,
289233A70DB2D0840083E9F9 /* MyMapView.m in Sources */,
289233AE0DB2D0DB0083E9F9 /* MainViewController.m in Sources */,
... ...
//
// Prefix header for all source files of the 'MapSample' target in the 'MapSample' project
// Prefix header for all source files of the 'MapTestbed' target in the 'MapTestbed' project
//
#ifdef __OBJC__
... ...