4d8bbdc7ef
Add to Git the current app version (the same available in the OriginalZip folder)
52 lines
1.3 KiB
Objective-C
52 lines
1.3 KiB
Objective-C
//
|
|
// PastquakesAnnotation.m
|
|
// Earthquake Network
|
|
//
|
|
// Created by Luca Beretta on 04/11/18.
|
|
// Copyright © 2018 Luca Beretta. All rights reserved.
|
|
//
|
|
|
|
#import "PastquakesAnnotation.h"
|
|
|
|
@implementation PastquakesAnnotation
|
|
|
|
-(id)initWithTitle:(NSString *)title location:(CLLocationCoordinate2D )coordinate intensita:(int)intensita{
|
|
|
|
self = [super init];
|
|
if (self) {
|
|
|
|
_title = title;
|
|
_coordinate = coordinate;
|
|
_intensita = intensita;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
-(MKAnnotationView *)annotationView{
|
|
|
|
MKAnnotationView *annotationView = [[MKAnnotationView alloc] initWithAnnotation:self reuseIdentifier:IDENTIFIER_ANNOTATION_PASTQUAKES];
|
|
annotationView.enabled = YES;
|
|
annotationView.canShowCallout = YES;
|
|
NSString *imageString;
|
|
switch (self.intensita) {
|
|
case 0:
|
|
imageString = @"star_white";
|
|
break;
|
|
case 1:
|
|
imageString = @"star_lightblue";
|
|
break;
|
|
case 2:
|
|
imageString = @"star_blue";
|
|
break;
|
|
default:
|
|
imageString = @"";
|
|
break;
|
|
}
|
|
|
|
annotationView.image = [UIImage imageNamed:imageString];
|
|
annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
|
|
return annotationView;
|
|
}
|
|
|
|
@end
|