开发者

Adding draggable support to annotation method

I have an app that deals with mapkit and annotation and it's working fine, now I'd like to add DRAGGABLE annotation. What do I have to do to add this function? This is my annotation.m class:

//
// MapDemoAnnotation.m
// MapDemo
//
// Creat开发者_开发知识库ed by Riccardo Queri on 12/01/11.
// Copyright 2011 Unipg. All rights reserved.
//

#import "MapAppAnnotation.h"


@implementation MapAppAnnotation

@synthesize coordinate=_coordinate;
- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate{
self = [super init];
if (self != nil) {
_coordinate = coordinate;
}
return self;
}
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate{


}
- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate andID:(NSUInteger)pinID{
self = [super init];
if (self != nil) {
_coordinate = coordinate;
_pinID = pinID;
}
return self;
}

- (NSString *)title {
return [NSString stringWithFormat:@"Boa %u", _pinID];
}

- (NSString *)subtitle {
return [NSString stringWithFormat:@"%.4f, %.4f", _coordinate.latitude, _coordinate.longitude];
}

@end


MKAnnotationView has draggable property..... you can use it. you can set it as per your needs.

thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜