Authored by Hal Mueller

updated sample code to match refactors to date

... ... @@ -27,6 +27,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
2B080D320F9FC12C00E947D5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EBE3696D0F673B95003DC21C /* MapView.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2BF3078F0F8AC5C0007014EE /* RM Unit Tests.app */;
remoteInfo = "Unit Tests";
};
2BB42BEE0F678951009967BB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EBE3696D0F673B95003DC21C /* MapView.xcodeproj */;
... ... @@ -184,6 +191,7 @@
isa = PBXGroup;
children = (
EBE3697D0F673B95003DC21C /* libMapView.a */,
2B080D330F9FC12C00E947D5 /* RM Unit Tests.app */,
);
name = Products;
sourceTree = "<group>";
... ... @@ -240,6 +248,13 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
2B080D330F9FC12C00E947D5 /* RM Unit Tests.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = "RM Unit Tests.app";
remoteRef = 2B080D320F9FC12C00E947D5 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
EBE3697D0F673B95003DC21C /* libMapView.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
... ...
... ... @@ -86,7 +86,7 @@
RMMarkerManager *markerManager = [mapView markerManager];
NSLog(@"New location: X:%lf Y:%lf", [marker location].x, [marker location].y);
NSLog(@"New location: X:%lf Y:%lf", [marker projectedLocation].easting, [marker projectedLocation].northing);
CGRect rect = [marker bounds];
[markerManager moveMarker:marker AtXY:CGPointMake(position.x,position.y +rect.size.height/3)];
... ...
... ... @@ -28,6 +28,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
2B080DB40F9FC14400E947D5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EBE3696D0F673B95003DC21C /* MapView.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2BF3078F0F8AC5C0007014EE /* RM Unit Tests.app */;
remoteInfo = "Unit Tests";
};
2BB42BEE0F678951009967BB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EBE3696D0F673B95003DC21C /* MapView.xcodeproj */;
... ... @@ -187,6 +194,7 @@
isa = PBXGroup;
children = (
EBE3697D0F673B95003DC21C /* libMapView.a */,
2B080DB50F9FC14400E947D5 /* RM Unit Tests.app */,
);
name = Products;
sourceTree = "<group>";
... ... @@ -243,6 +251,13 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
2B080DB50F9FC14400E947D5 /* RM Unit Tests.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = "RM Unit Tests.app";
remoteRef = 2B080DB40F9FC14400E947D5 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
EBE3697D0F673B95003DC21C /* libMapView.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
... ...
... ... @@ -27,6 +27,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
2B080DBD0F9FC14400E947D5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EBE3696D0F673B95003DC21C /* MapView.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2BF3078F0F8AC5C0007014EE /* RM Unit Tests.app */;
remoteInfo = "Unit Tests";
};
2BB42BEE0F678951009967BB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EBE3696D0F673B95003DC21C /* MapView.xcodeproj */;
... ... @@ -184,6 +191,7 @@
isa = PBXGroup;
children = (
EBE3697D0F673B95003DC21C /* libMapView.a */,
2B080DBE0F9FC14400E947D5 /* RM Unit Tests.app */,
);
name = Products;
sourceTree = "<group>";
... ... @@ -240,6 +248,13 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
2B080DBE0F9FC14400E947D5 /* RM Unit Tests.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = "RM Unit Tests.app";
remoteRef = 2B080DBD0F9FC14400E947D5 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
EBE3697D0F673B95003DC21C /* libMapView.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
... ...
... ... @@ -9,7 +9,7 @@
#import "MainView.h"
#import "RMOpenAerialMapSource.h"
#import "RMOpenStreetMapsSource.h"
#import "RMOpenStreetMapSource.h"
#import "RMMapContents.h"
#import "RMMapView.h"
#import "RMMarkerManager.h"
... ... @@ -66,7 +66,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
[mapView setDelegate:self];
id myTilesource = [[[RMOpenStreetMapsSource alloc] init] autorelease];
id myTilesource = [[[RMOpenStreetMapSource alloc] init] autorelease];
// have to initialize the RMMapContents object explicitly if we want it to use a particular tilesource
[[[RMMapContents alloc] initWithView:mapView
... ... @@ -127,8 +127,8 @@
LogMethod();
RMMarkerManager *mangler = [[[self mapView] contents] markerManager];
for (RMTestableMarker *theMarker in [mangler getMarkers]) {
CGPoint screenPosition = [mangler getMarkerScreenCoordinate:theMarker];
for (RMTestableMarker *theMarker in [mangler markers]) {
CGPoint screenPosition = [mangler screenCoordinatesForMarker:theMarker];
NSLog(@"%@ %3.1f %3.1f %f %f", theMarker,
theMarker.coordinate.latitude, theMarker.coordinate.longitude,
screenPosition.y, screenPosition.x);
... ...
... ... @@ -54,7 +54,7 @@
- (void)testMarkers
{
RMMarkerManager *markerManager = [mapView markerManager];
NSArray *markers = [markerManager getMarkers];
NSArray *markers = [markerManager markers];
NSLog(@"Nb markers %d", [markers count]);
... ... @@ -64,11 +64,11 @@
while (aMarker = (RMMarker *)[markerEnumerator nextObject])
{
RMXYPoint point = [aMarker location];
NSLog(@"Marker mercator location: X:%lf, Y:%lf", point.x, point.y);
CGPoint screenPoint = [markerManager getMarkerScreenCoordinate: aMarker];
RMProjectedPoint point = [aMarker projectedLocation];
NSLog(@"Marker projected location: east:%lf, north:%lf", point.easting, point.northing);
CGPoint screenPoint = [markerManager screenCoordinatesForMarker: aMarker];
NSLog(@"Marker screen location: X:%lf, Y:%lf", screenPoint.x, screenPoint.y);
CLLocationCoordinate2D coordinates = [markerManager getMarkerCoordinate2D: aMarker];
CLLocationCoordinate2D coordinates = [markerManager latitudeLongitudeForMarker: aMarker];
NSLog(@"Marker Lat/Lon location: Lat:%lf, Lon:%lf", coordinates.latitude, coordinates.longitude);
[markerManager removeMarker:aMarker];
... ... @@ -80,11 +80,8 @@
[markerManager addMarker:marker AtLatLong:[[mapView contents] mapCenter]];
// [markerManager addDefaultMarkerAt:[[mapView contents] mapCenter]];
[marker release];
markers = [markerManager getMarkersForScreenBounds];
markers = [markerManager markersWithinScreenBounds];
NSLog(@"Nb Markers in Screen: %d", [markers count]);
... ... @@ -110,7 +107,7 @@
RMMarkerManager *markerManager = [mapView markerManager];
NSLog(@"New location: X:%lf Y:%lf", [marker location].x, [marker location].y);
NSLog(@"New location: east:%lf north:%lf", [marker projectedLocation].easting, [marker projectedLocation].northing);
CGRect rect = [marker bounds];
[markerManager moveMarker:marker AtXY:CGPointMake(position.x,position.y +rect.size.height/3)];
... ...
... ... @@ -32,7 +32,7 @@
isa = PBXContainerItemProxy;
containerPortal = EBE3696D0F673B95003DC21C /* MapView.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2BF3078F0F8AC5C0007014EE /* RM Unit Tests.app */;
remoteGlobalIDString = 2BF3078F0F8AC5C0007014EE;
remoteInfo = "RM Unit Tests";
};
2BB42BEE0F678951009967BB /* PBXContainerItemProxy */ = {
... ...
... ... @@ -52,7 +52,7 @@
- (void)testMarkers
{
RMMarkerManager *markerManager = [mapView markerManager];
NSArray *markers = [markerManager getMarkers];
NSArray *markers = [markerManager markers];
NSLog(@"Nb markers %d", [markers count]);
... ... @@ -80,7 +80,7 @@
[markerManager addDefaultMarkerAt:[[mapView contents] mapCenter]];
[marker release];
markers = [markerManager getMarkersForScreenBounds];
markers = [markerManager markersWithinScreenBounds];
NSLog(@"Nb Markers in Screen: %d", [markers count]);
... ... @@ -110,7 +110,7 @@ shouldDragMarker:(RMMarker *)marker
RMMarkerManager *markerManager = [mapView markerManager];
NSLog(@"New location: X:%lf Y:%lf", [marker location].x, [marker location].y);
NSLog(@"New location: east:%lf north:%lf", [marker projectedLocation].easting, [marker projectedLocation].northing);
CGRect rect = [marker bounds];
[markerManager moveMarker:marker
... ... @@ -242,11 +242,11 @@ shouldDragMarker:(RMMarker *)marker
currentLocation = newLocation.coordinate;
RMMarkerManager *markerManager = [mapView markerManager];
NSArray *markers = [markerManager getMarkers];
NSArray *markers = [markerManager markers];
for (NSInteger i = 0; i < [markers count]; ++i)
{
RMMarker *marker = [markers objectAtIndex: i];
CLLocationCoordinate2D location = [markerManager getMarkerCoordinate2D: marker];
CLLocationCoordinate2D location = [markerManager latitudeLongitudeForMarker:marker];
if (location.latitude == oldLocation.coordinate.latitude &&
location.longitude == oldLocation.coordinate.longitude)
{
... ...
... ... @@ -25,21 +25,21 @@
isa = PBXContainerItemProxy;
containerPortal = 092AB7560F8D6EEA0059C0D2 /* MapView.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = B8C974590E8A19B2007D16AD /* libMapView.a */;
remoteGlobalIDString = B8C974590E8A19B2007D16AD;
remoteInfo = MapView;
};
092AB75F0F8D6EEA0059C0D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 092AB7560F8D6EEA0059C0D2 /* MapView.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2BF3078F0F8AC5C0007014EE /* RM Unit Tests.app */;
remoteGlobalIDString = 2BF3078F0F8AC5C0007014EE;
remoteInfo = "Unit Tests";
};
092AB7620F8D6F010059C0D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 092AB7560F8D6EEA0059C0D2 /* MapView.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = B8C974130E8A19B2007D16AD /* MapView */;
remoteGlobalIDString = B8C974130E8A19B2007D16AD;
remoteInfo = MapView;
};
/* End PBXContainerItemProxy section */
... ...