AGSCallout Class Reference


Description

Instances of this class represent a callout window. A callout can be used to display information on a map. The callout displays a title and a detail string. It also contains an accessory button that can be used to display a secondary view with more details.

By default, the map's callout shows information about a graphic when a user taps on the graphic. The map's callout also shows information for each location update provided by the GPS.

You can programatically display a callout using the showCalloutAtPoint: method from AGSMapView.

To hide the callout, you can set it's hidden property.

See also:
Conceptual Doc: Displaying a Callout
Since:
1.0

List of all members.

Public Member Functions

(void) - moveCalloutTo:pixelOffset:animated:
(void) - showCalloutAt:pixelOffset:animated:

Properties

BOOL accessoryButtonHidden
UIImage * accessoryButtonImage
UIButtonType accessoryButtonType
BOOL autoAdjustWidth
UIColor * color
CGFloat cornerRadius
UIView * customView
NSString * detail
UIColor * detailColor
UIColor * highlight
UIImage * image
AGSCalloutLeaderPosition leaderPositionFlags
AGSPointmapLocation
AGSMapViewmapView
CGSize margin
CGFloat maxWidth
CGPoint pixelOffset
NSString * title
UIColor * titleColor
CGFloat width

Member Function Documentation

- (void) moveCalloutTo: (AGSPoint *)  mapLocation
pixelOffset: (CGPoint)  pixelOffset
animated: (BOOL)  animated 

Moves the callout to the specified map location and pixel offset.

Parameters:
mapLocation The location on the map to move to.
pixelOffset The offset from the map location to place the callout.
animated Flag to determine if action should be animated.
Since:
1.0
- (void) showCalloutAt: (AGSPoint *)  mapLocation
pixelOffset: (CGPoint)  pixelOffset
animated: (BOOL)  animated 
Since:
2.1

Property Documentation

- (BOOL) accessoryButtonHidden [read, write, assign]

Shows or hides the accessory button.

Since:
1.0
- (UIImage*) accessoryButtonImage [read, write, retain]

The optional image used for the accessory button.

Since:
1.8
- (UIButtonType) accessoryButtonType [read, write, assign]

The type of button for the accessory button.

Since:
1.8
- (BOOL) autoAdjustWidth [read, write, assign]

This is a parameter than specifies that the width of the callout should adjust to the size of the text. This parameter is ignored if using a custom view.

Since:
1.8
- (UIColor*) color [read, write, retain]

Background color of callout. Default is black.

Since:
1.0
- (CGFloat) cornerRadius [read, write, assign]

The corner radius in points for the rounded corners. This property is ignored if not using a custom view.

Since:
1.8
- (UIView*) customView [read, write, retain]

The custom view to display in the callout. If this property is specified, the developer is responsible for the content displayed in the callout. The callout will expand to fit the dimensions of the custom view. Most of the other properties related to the look of the callout will be ignored.

Since:
1.8
- (NSString*) detail [read, write, copy]

Text for detail string. The detail for a graphic is provided by infoTemplateDelegate on AGSGraphic. The detail for a GPS location is provided by infoTemplateDelegate on AGSGPS.

Since:
1.0
- (UIColor*) detailColor [read, write, retain]

Detail text color. Default is white.

Since:
1.0
- (UIColor*) highlight [read, write, retain]

Highlight color of callout. Default is white.

Since:
1.0
- (UIImage*) image [read, write, retain]

The optional image used for displaying content to the left of the text labels. The image will be scaled to 40x40 points.

Since:
1.8
- (AGSCalloutLeaderPosition) leaderPositionFlags [read, write, assign]

Flags specifying the possible leader locations when showing the callout. Possible values include:

  • AGSCalloutLeaderPositionLeft
  • AGSCalloutLeaderPositionRight
  • AGSCalloutLeaderPositionTop
  • AGSCalloutLeaderPositionBottom
  • AGSCalloutLeaderPositionAny

These values can be combined with the bitwise OR operator. The default value is AGSCalloutLeaderPositionBottom .

AGSCalloutLeaderPositionAny will attempt to find the best location for the given point. On the iPad, precedence is given based on the following sequence - left, right, bottom, top. On all other iOS devices, it is - bottom, top, left, right.

Since:
2.1
- (AGSPoint*) mapLocation [read, retain]

Location in map coordinates where the callout's leader should point to. If the callout is shown in response to a user tap, this property contains the tapped location. If the callout is shown in response to a GPS location update, this property contains that location.

Since:
1.0
- (AGSMapView*) mapView [read, assign]

The map that will display the callout.

Since:
1.0
- (CGSize) margin [read, write, assign]

The margin in points around the customView. This property is ignored if not using a custom view.

Since:
1.8
- (CGFloat) maxWidth [read, write, assign]

The maximum width of the callout if the callout is autosizing to the text. To autosize to the text width, set the autoAdjustWidth property to YES. This property is ignored if using a custom view.

Since:
1.8
- (CGPoint) pixelOffset [read, assign]

Pixels offset in screen coordinates from the map location that the callout leader should point to. This is generally used with Marker symbols that have offsets so that the callout will display in the correct location as the map is scaled (zoomed in or out). A positive x-value adjust the callout to the right. A positive y-value adjusts the callout down.

Since:
1.0
- (NSString*) title [read, write, copy]

Text for title label. The title for a graphic is provided by infoTemplateDelegate on AGSGraphic. The title for a GPS location is provided by infoTemplateDelegate on AGSGPS.

Since:
1.0
- (UIColor*) titleColor [read, write, retain]

Text color. Default is white.

Since:
1.0
- (CGFloat) width [read, write, assign]

Callout width. This property is ignored if using a custom view.

Since:
1.0