Skip to content

Commit

Permalink
Added support for checking max 25 pins when uploading check. Added su…
Browse files Browse the repository at this point in the history
…pport for numbers on the pins.
  • Loading branch information
robbertvanginkel committed Jul 17, 2011
1 parent 93a992b commit 356da5f
Show file tree
Hide file tree
Showing 51 changed files with 23 additions and 1 deletion.
Binary file added The Race App/Pins@2x/PinNumber10@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber11@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber12@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber13@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber14@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber15@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber16@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber17@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber18@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber19@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber1@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber20@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber21@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber22@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber23@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber24@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber25@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber2@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber3@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber4@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber5@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber6@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber7@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber8@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumber9@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added The Race App/Pins@2x/PinNumberGreen10@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen11@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen12@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen13@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen14@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen15@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen16@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen17@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen18@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen19@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen1@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen20@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen21@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen22@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen23@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen24@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen25@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen3@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen4@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen5@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen6@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen7@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen8@2x.png
Binary file added The Race App/Pins@2x/PinNumberGreen9@2x.png
14 changes: 14 additions & 0 deletions The Race App/RaceViewController.m
Expand Up @@ -11,6 +11,8 @@
#import "TraceOverlayView.h"
#import "GPSTracePlayer.h"

#define kPinNumberTag 343

@interface RaceViewController ()

@property(nonatomic, retain) Trace * currentTrace;
Expand Down Expand Up @@ -136,6 +138,8 @@ - (void)raceTracer:(RaceTracer *)tracer reachedCheckpointAtIndex:(NSUInteger)che
MKPinAnnotationView * checkPointPinView = (MKPinAnnotationView *)[mapView viewForAnnotation:startAnnotation];

checkPointPinView.pinColor = MKPinAnnotationColorGreen;
UIImageView *imgView = (UIImageView*)[checkPointPinView viewWithTag:kPinNumberTag];
[imgView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"PinNumberGreen%d.png", checkpointReachedIdx+1]]];
}

- (void)raceTracerReachedStartPoint:(RaceTracer *)tracer;
Expand All @@ -144,6 +148,8 @@ - (void)raceTracerReachedStartPoint:(RaceTracer *)tracer;
MKPinAnnotationView * checkPointPinView = (MKPinAnnotationView *)[mapView viewForAnnotation:startAnnotation];

checkPointPinView.pinColor = MKPinAnnotationColorGreen;
UIImageView *imgView = (UIImageView*)[checkPointPinView viewWithTag:kPinNumberTag];
[imgView setImage:[UIImage imageNamed:@"PinNumberGreen1.png"]];

[UIView animateWithDuration:1
animations:^{
Expand Down Expand Up @@ -233,6 +239,14 @@ - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id<MKAn
MKPinAnnotationView *checkpointView = (MKPinAnnotationView*)[mapView dequeueReusableAnnotationViewWithIdentifier:checkpointViewIdentifier];
if (!checkpointView) {
checkpointView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:checkpointViewIdentifier] autorelease];

NSUInteger index = [checkpoints indexOfObject:annotation];

UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"PinNumber%d.png", index+1]]];
[image setFrame:CGRectMake(-1, -1, 17, 17)];
[image setTag:kPinNumberTag];
[checkpointView addSubview:image];
[image release];
checkpointView.pinColor = MKPinAnnotationColorRed;
checkpointView.animatesDrop = YES;
}
Expand Down
10 changes: 9 additions & 1 deletion The Race App/TrackCreatorViewController.m
Expand Up @@ -73,8 +73,16 @@ - (void)saveTrack:(id)sender {
otherButtonTitles:nil] autorelease];
[errorAlert show];
return;
} else if ([self.coordinates count]>25) {
UIAlertView *errorAlert = [[[UIAlertView alloc] initWithTitle:@"Too much checkpoints!"
message:@"Please remove some checkpoints. The maximum number of checkpoints is 25"
delegate:nil
cancelButtonTitle:@"Dismiss"
otherButtonTitles:nil] autorelease];
[errorAlert show];
return;
} else {
//Save track and pass it on to some object.
//Save track and pass it on to the server
NSMutableArray *locationArray = [[NSMutableArray alloc] init];
for (int i = 0; i<[self.coordinates count]; i++) {
DDAnnotation *ann = [self.coordinates objectAtIndex:i];
Expand Down

0 comments on commit 356da5f

Please sign in to comment.