SGAnnotationView


Used to display information about SGAnnotation in an AR enviornment.

Superclass: UIView
Declared In: SGAnnotationView.h

Discussion

SGAnnotationViews are the only views that can be rendered in the SGARView . The annotation view has two different modes, when it is being inspected and when it is not being inspected. You can toggle through inspection modes by calling inspectView: . When an annotation view is created it calls inspectView: on itself with the value NO. When NO is specifed the view enters into target mode. If YES is passed into inspectView: , the view switches to inspect mode. Target mode is intended to be just a target in in the AR enviornment; something that allows the user to inspect further by generating a touch event. When a touch event occurs on an annotation view, shouldInspectAnntationView: is called. Anytime throughout the life-cycle of the view, you can call inspectView: and it will change its subviews properly, independent of its enviornment. A SGAnnotationView has two display enviornments. The first is within the augmented reality view. The second is as a UIView was intended, using CoreAnimation. When the view is within the AR enviornment, the orign within the frame is ignored. The AR enviornment must place the view based on its relative position of the device and the coordinate obtained from annotation . When the annotation view is rendered as a UIView, in most cases, it will be a subview of SGARView.



Methods

-close

Only works in inspector mode. Returns the view back to target mode.

-drawAnnotationView

The current implementation of this method does nothing. If enableOpenGL is set to YES, then this method will be called everytime the AR enviornment needs to render the view.

-initAtPoint:reuseIdentifier:

Initialize a new annotation view.

-inspectView:

Changes the inspection type of the view.

-prepareForReuse

Called when the view is removed from the reuse queue.

-setContainerImage:

The UIImage that will be displayed when this view is added to an instance of SGAnnotationViewContainer . The default image is the UIImage representation of the current layout of the annotaiton view.


close


Only works in inspector mode. Returns the view back to target mode.

- (void) close; 
Discussion

If the annotation view is a subview of the AR view, it will removeFromSuperview: and call inspectView: with NO. The annotation view should then return back to target mode join back with its brothers.


drawAnnotationView


The current implementation of this method does nothing. If enableOpenGL is set to YES, then this method will be called everytime the AR enviornment needs to render the view.

- (void) drawAnnotationView; 


initAtPoint:reuseIdentifier:


Initialize a new annotation view.

- (id) initAtPoint:(CGPoint)pt reuseIdentifier:(NSString*)identifier; 
Parameters
pt

The origin of the view when it is not being drawn in the AR enviornment.

identifier

The identifier for the view.

Return Value

A new instance of SGAnnotationView.


inspectView:


Changes the inspection type of the view.

- (void) inspectView:(BOOL)inspect; 
Parameters
inspect

YES will put the view in inspect mode. NO wil put the view in target mode.


prepareForReuse


Called when the view is removed from the reuse queue.

- (void) prepareForReuse; 
Discussion

The default implementaiton of this method resets its subviews. You can override it in your custom annotation views and use it to put the view in a specific state.


setContainerImage:


The UIImage that will be displayed when this view is added to an instance of SGAnnotationViewContainer. The default image is the UIImage representation of the current layout of the annotaiton view.

- (void) setContainerImage:(UIImage*)image; 
Parameters
image

Properties

altitude

The altitude of the view. The default is 0. Altitude is expressed in meters.

annotation

The source of the view's location in the AR enviornment.

bearing

The bearing of the view calculated from the annotation and the device's current location. Bearing is expressed in radians.

closeButton

A close button that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.

delegate

The delegate that recieves inspection and close notifications.

detailedLabel

A detailed label that is used when inspectorType is not kSGAnnotationViewInspectoryType_Custom and the view is in inspect mode.

distance

The distance of the view calculated from the annotation and the device's current location. Distance is expressed in meters.

enableOpenGL

Ignores the UIView components of the view, and calls drawAnnotationView when it needs to be rendered in the AR enviornment.

inspectorType

The style of the view when it is being inspected.

isBeingInspected

If YES, the the view is in inspect mode. Otherwise; NO.

isCapturable

If YES, the view can be added to the SGMovableStack . Otherwise, NO.

messageLabel

A title label that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.

photoImageView

A title label that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.

pinColor

The pin color to use when the view is in target mode and targetType is set kSGAnnotationViewTargetType_Pin . The default is kSGPinColor_Red .

radarTargetButton

The UIButton that is displayed in the SGRadar .

resuseIdentifier

Use this identifier to dequeue unused annotation views from SGARView .

targetImageView

The image that is shown when the targetType is set to kSGAnnotationViewTargetType_Glass .

targetType

The style of the view when it is not being inspected.

titleLabel

A title label that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.


altitude


The altitude of the view. The default is 0. Altitude is expressed in meters.

@property (
    nonatomic,
    assign) double altitude; 


annotation


The source of the view's location in the AR enviornment.

@property (
    nonatomic,
    assign) id<MKAnnotation> annotation; 


bearing


The bearing of the view calculated from the annotation and the device's current location. Bearing is expressed in radians.

@property (
    nonatomic,
    readonly) double bearing; 


closeButton


A close button that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.

@property (
    nonatomic,
    retain,
    readonly) UIButton* closeButton; 
Discussion

The default position is in the upper left-hand corner of the view.


delegate


The delegate that recieves inspection and close notifications.

@property (
    nonatomic,
    assign) id<SGAnnotationViewDelegate> delegate; 


detailedLabel


A detailed label that is used when inspectorType is not kSGAnnotationViewInspectoryType_Custom and the view is in inspect mode.

@property (
    nonatomic,
    retain,
    readonly) UILabel* detailedLabel; 


distance


The distance of the view calculated from the annotation and the device's current location. Distance is expressed in meters.

@property (
    nonatomic,
    readonly) double distance; 


enableOpenGL


Ignores the UIView components of the view, and calls drawAnnotationView when it needs to be rendered in the AR enviornment.

@property (
    nonatomic,
    assign) BOOL enableOpenGL; 


inspectorType


The style of the view when it is being inspected.

@property (
    nonatomic,
    assign) SGAnnotationViewInspectorType inspectorType; 


isBeingInspected


If YES, the the view is in inspect mode. Otherwise; NO.

@property (
    nonatomic,
    readonly) BOOL isBeingInspected; 


isCapturable


If YES, the view can be added to the SGMovableStack. Otherwise, NO.

@property (
    nonatomic,
    assign) BOOL isCapturable; 


messageLabel


A title label that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.

@property (
    nonatomic,
    retain,
    readonly) UILabel* messageLabel; 


photoImageView


A title label that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.

@property (
    nonatomic,
    retain,
    readonly) UIImageView* photoImageView; 


pinColor


The pin color to use when the view is in target mode and targetType is set kSGAnnotationViewTargetType_Pin . The default is kSGPinColor_Red.

@property (
    nonatomic,
    assign) SGPinColor pinColor; 


radarTargetButton


The UIButton that is displayed in the SGRadar.

@property (
    nonatomic,
    readonly) UIButton* radarTargetButton; 


resuseIdentifier


Use this identifier to dequeue unused annotation views from SGARView.

@property (
    nonatomic,
    readonly) NSString* resuseIdentifier; 


targetImageView


The image that is shown when the targetType is set to kSGAnnotationViewTargetType_Glass.

@property (
    nonatomic,
    retain,
    readonly) UIImageView* targetImageView; 


targetType


The style of the view when it is not being inspected.

@property (
    nonatomic,
    assign) SGAnnotationViewTargetType targetType; 


titleLabel


A title label that is used when inspectorType is not in kSGAnnotationViewInspectorType_Custom and the view is in inspect mode.

@property (
    nonatomic,
    retain,
    readonly) UILabel* titleLabel; 

© SimpleGeo Last Updated: 03/31/2010