Here is the interface to MapAnnotation
//
// CSMapAnnotation.h
// mapLines
//
// Created by Craig on 5/15/09.
// Copyright 2009 Craig Spitzkoff. All rights reserved.
//
import
import
// types of annotations for which we will provide annotation views.
typedef enum {
MapAnnotationTypeStart = 0,
MapAnnotationTypeEnd = 1,
MapAnnotationTypeImage = 2
} MapAnnotationType;
@interface MapAnnotation : NSObject
{
CLLocationCoordinate2D _coordinate;
MapAnnotationType annotationType;
NSString title;
NSString subtitle;
NSString userData;
NSString speed;
NSString* identifier;
}
@property (nonatomic, retain) NSString *speed;
@property (nonatomic, retain) NSString *identifier;
-(id) initWithCoordinate:(CLLocationCoordinate2D)coordinate
annotationType:(MapAnnotationType) annotationType
title:(NSString*)title
subtitle: (NSString*) subtitle
speed: (NSString *) speed
identifier: (NSString *) identifier;
-(id) setWithCoordinate:(CLLocationCoordinate2D)coordinate
annotationType:(MapAnnotationType) annotationType
title:(NSString*)title
subtitle: (NSString*) subtitle
speed: (NSString *) speed
identifier: (NSString *) identifier;
@property MapAnnotationType annotationType;
@property (nonatomic, retain) NSString* userData;
@end
And here is the implementation
//
// CSMapAnnotation.m
// mapLines
//
// Created by Craig on 5/15/09.
// Copyright 2009 Craig Spitzkoff. All rights reserved.
//
import "MapAnnotation.h"
@implementation MapAnnotation
@synthesize coordinate = _coordinate;
@synthesize annotationType = _annotationType;
@synthesize userData = _userData;
@synthesize speed;
@synthesize identifier;
-(id) initWithCoordinate:(CLLocationCoordinate2D)coordinate
annotationType:(MapAnnotationType) annotationType
title:(NSString*)title
subtitle: (NSString*) subtitle
speed: (NSString *) speedz
identifier: (NSString *) identifierz
{
self = [super init];
_coordinate = coordinate;
_title = [title retain];
_subtitle = [subtitle retain];
_annotationType = annotationType;
speed = speedz;
identifier = identifierz;
return self;
}
-(id) setWithCoordinate:(CLLocationCoordinate2D)coordinate
annotationType:(MapAnnotationType) annotationType
title:(NSString*)title
subtitle: (NSString*) subtitle
speed: (NSString *) speedz
identifier: (NSString *) identifierz
{
_coordinate = coordinate;
_title = [title retain];
_subtitle = [subtitle retain];
_annotationType = annotationType;
speed = speedz;
identifier = identifierz;
return self;
}
-(void) dealloc
{
[_title release];
[_userData release];
[super dealloc];
}
@end