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
//
|
|
// ReteSismicaAnnotation.m
|
|
// Earthquake Network
|
|
//
|
|
// Created by Luca Beretta on 01/11/18.
|
|
// Copyright © 2018 Luca Beretta. All rights reserved.
|
|
//
|
|
|
|
#import "ReteSismicaAnnotation.h"
|
|
#import "Costanti.h"
|
|
|
|
@implementation ReteSismicaAnnotation
|
|
|
|
-(id)initWithTitle:(NSString *)title location:(CLLocationCoordinate2D )coordinate magnitudo:(int)magnitude{
|
|
|
|
self = [super init];
|
|
if (self) {
|
|
|
|
_title = title;
|
|
_coordinate = coordinate;
|
|
_magnitude = magnitude;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
-(MKAnnotationView *)annotationView{
|
|
|
|
MKAnnotationView *annotationView = [[MKAnnotationView alloc] initWithAnnotation:self reuseIdentifier:IDENTIFIER_ANNOTATION_RETESMARTPHONE];
|
|
annotationView.enabled = YES;
|
|
annotationView.canShowCallout = YES;
|
|
NSString *imageString;
|
|
switch (self.magnitude) {
|
|
case 1:
|
|
imageString = @"star_green";
|
|
break;
|
|
case 2:
|
|
imageString = @"star_yellow";
|
|
break;
|
|
case 3:
|
|
imageString = @"star_red1";
|
|
break;
|
|
default:
|
|
imageString = @"";
|
|
break;
|
|
}
|
|
|
|
annotationView.image = [UIImage imageNamed:imageString];
|
|
annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
|
|
return annotationView;
|
|
}
|
|
@end
|