OSAnnotation Protocol Reference
Conforms to | NSObject |
Declared in | OSAnnotation.h |
Overview
The OSAnnotation
protocol is used with OSAnnotationView to add annotations to an OSMapView.
To use this protocol, adopt it in classes which represent points of interest. A class that adopts this protocol must implement the coordinate property.
For simple use cases, consider using OSPointAnnotation instead of defining a new class.
Tasks
Specifying co-ordinates
-
coordinate
The center point of the annotation, as a CLLocationCoordinate2D. The implementation of this property must be KVO-compliant. If gridPoint is implemented and returns a valid OSGridPoint, it is used in preference to the coordinate.
property required method -
gridPoint
The center point of the annotation, as an OSGridPoint. The implementation of this property must be KVO-compliant. If this returns a valid OSGridPoint, it is used instead of the coordinate.
property
Metadata
Dragging annotations
-
– setCoordinate:
Called after an annotation is dragged, unless the object responds to setGridPoint:.
-
– setGridPoint:
Called in preference to setCoordinate:.
Properties
coordinate
The center point of the annotation, as a CLLocationCoordinate2D. The implementation of this property must be KVO-compliant. If gridPoint is implemented and returns a valid OSGridPoint, it is used in preference to the coordinate.
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate
Declared In
OSAnnotation.h
gridPoint
The center point of the annotation, as an OSGridPoint. The implementation of this property must be KVO-compliant. If this returns a valid OSGridPoint, it is used instead of the coordinate.
@property (nonatomic, readonly) OSGridPoint gridPoint
Declared In
OSAnnotation.h
subtitle
The subtitle of the annotation.
@property (nonatomic, readonly, copy) NSString *subtitle
Declared In
OSAnnotation.h
Instance Methods
setCoordinate:
Called after an annotation is dragged, unless the object responds to setGridPoint:.
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate
Declared In
OSAnnotation.h
setGridPoint:
Called in preference to setCoordinate:.
- (void)setGridPoint:(OSGridPoint)gridPoint
Declared In
OSAnnotation.h