Authored by Thomas Rasch

o Sample code updates

... ... @@ -236,6 +236,7 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MarkerMurder" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
... ...
... ... @@ -39,8 +39,7 @@
CLLocationCoordinate2D firstLocation;
firstLocation.latitude = 51.2795;
firstLocation.longitude = 1.082;
self.mapView = [[[RMMapView alloc] initWithFrame:CGRectMake(10,20,200,300)
WithLocation:firstLocation] autorelease];
self.mapView = [[[RMMapView alloc] initWithFrame:CGRectMake(10,20,200,300)] autorelease];
// [[mapView contents] setZoom:10.0];
[mapView setBackgroundColor:[UIColor greenColor]];
[[self view] addSubview:mapView];
... ...
... ... @@ -184,7 +184,14 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ProgrammaticMap" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectReferences = (
... ...
... ... @@ -8,7 +8,7 @@
#import "MainView.h"
#import "RMCloudMadeMapSource.h"
#import "RMOpenStreetMapSource.h"
@implementation MainViewController
... ... @@ -27,12 +27,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
[mapView setDelegate:self];
id myTilesource = [[[RMCloudMadeMapSource alloc] initWithAccessKey:@"0199bdee456e59ce950b0156029d6934" styleNumber:999] autorelease];
// have to initialize the RMMapContents object explicitly if we want it to use a particular tilesource
[[[RMMapContents alloc] initWithView:mapView
tilesource:myTilesource] autorelease];
/* -- Uncomment to constrain view
[mapView setConstraintsSW:((CLLocationCoordinate2D){-33.942221,150.996094})
NE:((CLLocationCoordinate2D){-33.771157,151.32019})]; */
... ...
... ... @@ -19,7 +19,7 @@
[window makeKeyAndVisible];
}
-(RMMapContents *)mapContents
- (RMMapContents *)mapContents
{
return self.rootViewController.mainViewController.mapView.contents;
}
... ...
... ... @@ -79,7 +79,7 @@
anchorPoint:CGPointMake(0.5, 1.0)];
[marker changeLabelUsingText:@"Hello"];
[markerManager addMarker:marker AtLatLong:[[mapView contents] mapCenter]];
[markerManager addMarker:marker atLatLong:[[mapView contents] mapCenter]];
[marker release];
markers = [markerManager markersWithinScreenBounds];
... ... @@ -111,7 +111,7 @@
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)];
[markerManager moveMarker:marker atXY:CGPointMake(position.x,position.y +rect.size.height/3)];
}
... ... @@ -129,14 +129,14 @@
[marker replaceUIImage:[UIImage imageNamed:@"marker-red.png"]];
[marker changeLabelUsingText:@"World"];
tap=YES;
[markerManager moveMarker:marker AtXY:CGPointMake([marker position].x,[marker position].y + 20.0)];
[markerManager moveMarker:marker atXY:CGPointMake([marker position].x,[marker position].y + 20.0)];
[mapView setDeceleration:YES];
}else
{
[marker replaceUIImage:[UIImage imageNamed:@"marker-blue.png"]
anchorPoint:CGPointMake(0.5, 1.0)];
[marker changeLabelUsingText:@"Hello"];
[markerManager moveMarker:marker AtXY:CGPointMake([marker position].x,[marker position].y - 20.0)];
[markerManager moveMarker:marker atXY:CGPointMake([marker position].x,[marker position].y - 20.0)];
tap=NO;
[mapView setDeceleration:NO];
}
... ... @@ -165,7 +165,7 @@
anchorPoint:CGPointMake(0.5, 1.0)];
[marker setTextForegroundColor:[UIColor blueColor]];
[marker changeLabelUsingText:@"Hello"];
[markerManager addMarker:marker AtLatLong:[[mapView contents] mapCenter]];
[markerManager addMarker:marker atLatLong:[[mapView contents] mapCenter]];
[marker release];
NSLog(@"Center: Lat: %lf Lon: %lf", mapView.contents.mapCenter.latitude, mapView.contents.mapCenter.longitude);
}
... ...
... ... @@ -202,6 +202,7 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SimpleMap" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
... ...
... ... @@ -74,7 +74,7 @@
[marker changeLabelUsingText:@"Hello"];
[markerManager addMarker:marker
AtLatLong:[[mapView contents] mapCenter]];
atLatLong:[[mapView contents] mapCenter]];
[marker release];
markers = [markerManager markersWithinScreenBounds];
... ... @@ -111,7 +111,7 @@ shouldDragMarker:(RMMarker *)marker
CGRect rect = [marker bounds];
[markerManager moveMarker:marker
AtXY:CGPointMake(position.x,position.y +rect.size.height/3)];
atXY:CGPointMake(position.x,position.y +rect.size.height/3)];
}
... ... @@ -133,7 +133,7 @@ shouldDragMarker:(RMMarker *)marker
[marker changeLabelUsingText:@"World"];
tap=YES;
[markerManager moveMarker:marker
AtXY:CGPointMake([marker position].x,[marker position].y + 20.0)];
atXY:CGPointMake([marker position].x,[marker position].y + 20.0)];
[mapView setDeceleration:YES];
}
else
... ... @@ -142,7 +142,7 @@ shouldDragMarker:(RMMarker *)marker
anchorPoint:CGPointMake(0.5, 1.0)];
[marker changeLabelUsingText:@"Hello"];
[markerManager moveMarker:marker
AtXY:CGPointMake([marker position].x, [marker position].y - 20.0)];
atXY:CGPointMake([marker position].x, [marker position].y - 20.0)];
tap = NO;
[mapView setDeceleration:NO];
}
... ... @@ -195,7 +195,7 @@ shouldDragMarker:(RMMarker *)marker
[marker setTextForegroundColor:[UIColor blueColor]];
[marker changeLabelUsingText:@"Hello"];
[markerManager addMarker:marker
AtLatLong:currentLocation];
atLatLong:currentLocation];
[marker release];
}
... ... @@ -245,7 +245,7 @@ shouldDragMarker:(RMMarker *)marker
location.longitude == oldLocation.coordinate.longitude)
{
[markerManager moveMarker: marker
AtLatLon: newLocation.coordinate];
atLatLon: newLocation.coordinate];
break; // We're done.
}
}
... ...
... ... @@ -201,7 +201,14 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SimpleSampleMap" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectReferences = (
... ...
... ... @@ -23,7 +23,7 @@
latlong.latitude = 43.61675;
latlong.longitude = 6.97167;
RMMapView *map = [[RMMapView alloc]initWithFrame:CGRectMake(0.0, 0.0, [[UIScreen mainScreen]applicationFrame].size.width, [[UIScreen mainScreen]applicationFrame].size.height-79) WithLocation:latlong];
RMMapView *map = [[RMMapView alloc]initWithFrame:CGRectMake(0.0, 0.0, [[UIScreen mainScreen]applicationFrame].size.width, [[UIScreen mainScreen]applicationFrame].size.height-79)];
[self setMapView:map];
[map release];
[[[self mapView] contents]setZoom:18];
... ...