10.2.5: AGSCallout Class Reference
10.2.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
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 can display a title and a detail string. It can also display a picture to the left of the title and detail, and an accessory button to the right which can be used to present a secondary view with more details.

You can change the content and look of the callout by setting its properties. You can also embed a custom view if you want to completely customize the layout.

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

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

See also
Conceptual Doc: Displaying a Callout
AGSCalloutDelegate and AGSLayerCalloutDelegate
Since
1.0
Inheritance diagram for AGSCallout:

Instance Methods

(void) - dismiss
 
(void) - moveCalloutTo:pixelOffset:animated:
 
(void) - moveCalloutTo:pixelOffset:rotateOffsetWithMap:animated:
 
(void) - moveCalloutTo:screenOffset:animated:
 
(void) - moveCalloutTo:screenOffset:rotateOffsetWithMap:animated:
 
(void) - showCalloutAt:pixelOffset:animated:
 
(void) - showCalloutAt:pixelOffset:rotateOffsetWithMap:animated:
 
(void) - showCalloutAt:screenOffset:animated:
 
(void) - showCalloutAt:screenOffset:rotateOffsetWithMap:animated:
 
(BOOL) - showCalloutAtPoint:forFeature:layer:animated:
 
(void) - showCalloutAtPoint:forGraphic:animated:
 
(BOOL) - showCalloutForLocationDisplay
 

Properties

BOOL accessoryButtonHidden
 
UIImage * accessoryButtonImage
 
UIButtonType accessoryButtonType
 
BOOL autoAdjustWidth
 
AGSColorborderColor
 
CGFloat borderWidth
 
AGSColorcolor
 
CGFloat cornerRadius
 
AGSViewcustomView
 
id< AGSCalloutDelegatedelegate
 
NSString * detail
 
AGSColordetailColor
 
AGSColorhighlight
 
AGSImageimage
 
AGSCalloutLeaderPosition leaderPositionFlags
 
AGSPointmapLocation
 
AGSMapViewmapView
 
CGSize margin
 
CGFloat maxWidth
 
CGPoint pixelOffset
 
id< AGSFeaturerepresentedFeature
 
AGSLayerrepresentedLayer
 
AGSLocationDisplayrepresentedLocationDisplay
 
id representedObject
 
CGPoint screenOffset
 
NSString * title
 
AGSColortitleColor
 
CGFloat width
 

Method Documentation

- (void) dismiss

Dismisses the callout.

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

Moves the callout to the specified map location and screen point offset.

Parameters
mapLocationThe location on the map to move to.
pixelOffsetThe offset from the map location to place the callout in screen points.
animatedFlag to determine if action should be animated.
Deprecated:
Deprecated at 10.2. Use moveCalloutTo:screenOffset:animated: instead.
Since
1.0
- (void) moveCalloutTo: (AGSPoint *)  mapLocation
pixelOffset: (CGPoint)  pixelOffset
rotateOffsetWithMap: (BOOL)  rotateOffsetWithMap
animated: (BOOL)  animated 

Move callout to the specified location

Parameters
mapLocation
pixelOffset
rotateOffsetWithMap
animated
Deprecated:
Deprecated at 10.2. Use moveCalloutTo:screenOffset:rotateOffsetWithMap:animated: instead.
Since
10.1.1
- (void) moveCalloutTo: (AGSPoint *)  mapLocation
screenOffset: (CGPoint)  screenOffset
animated: (BOOL)  animated 

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

Parameters
mapLocationThe location on the map to move to.
screenOffsetThe offset from the map location to place the callout in screen points.
animatedFlag to determine if action should be animated.
Since
10.2
- (void) moveCalloutTo: (AGSPoint *)  mapLocation
screenOffset: (CGPoint)  screenOffset
rotateOffsetWithMap: (BOOL)  rotateOffsetWithMap
animated: (BOOL)  animated 

Move callout to the specified location

Parameters
mapLocation
screenOffset
rotateOffsetWithMap
animated
Since
10.2
- (void) showCalloutAt: (AGSPoint *)  mapLocation
pixelOffset: (CGPoint)  pixelOffset
animated: (BOOL)  animated 

Shows the callout at the specified map location and screen point offset

Parameters
mapLocationThe location on the map to move to.
pixelOffsetThe offset from the map location to place the callout in screen points.
animatedFlag to determine if action should be animated.
Deprecated:
Deprecated at 10.2. Use showCalloutAt:screenOffset:animated: instead.
Since
2.1
- (void) showCalloutAt: (AGSPoint *)  mapLocation
pixelOffset: (CGPoint)  pixelOffset
rotateOffsetWithMap: (BOOL)  rotateOffsetWithMap
animated: (BOOL)  animated 

Show callout at specified location

Parameters
mapLocation
pixelOffset
rotateOffsetWithMap
animated
Deprecated:
Deprecated at 10.2. Use showCalloutAt:screenOffset:rotateOffsetWithMap:animated: instead.
Since
10.1.1
- (void) showCalloutAt: (AGSPoint *)  mapLocation
screenOffset: (CGPoint)  screenOffset
animated: (BOOL)  animated 

Shows the callout at the specified map location and point offset

Parameters
mapLocationThe location on the map to move to.
screenOffsetThe offset from the map location to place the callout in screen points.
animatedFlag to determine if action should be animated.
Since
10.2
- (void) showCalloutAt: (AGSPoint *)  mapLocation
screenOffset: (CGPoint)  screenOffset
rotateOffsetWithMap: (BOOL)  rotateOffsetWithMap
animated: (BOOL)  animated 

Show callout at specified location

Parameters
mapLocation
screenOffset
rotateOffsetWithMap
animated
Since
10.2
- (BOOL) showCalloutAtPoint: (AGSPoint *)  mapPoint
forFeature: (id< AGSFeature >)  feature
layer: (AGSLayer< AGSHitTestable > *)  layer
animated: (BOOL)  animated 

Show callout at specified location for a specific feature. If the layer that the feature belongs to contains a valid calloutDelegate (AGSHitTestable::calloutDelegate), it is given an opportunity to display information about the feature in the callout via callout:willShowForFeature:layer:mapPoint: (AGSLayerCalloutDelegate-p) Otherwise, the callout's delegate, if it exists, is given an opportunity through callout:willShowForFeature:layer:mapPoint: (AGSCalloutDelegate-p)

Parameters
mapPointMap point that will be used for the callout. You can pass nil if you want the center of the feature to be used. If the graphic is represented by a marker symbol, then the mapPoint is ignored in order to best place the callout.
featureAGSFeature that the callout is displaying for.
layerAGSLayer that the feature is in.
animatedDetermines whether or not the callout should animate when it is shown.
Returns
Value indicating whether or not the callout did actually show.
Since
10.2
- (void) showCalloutAtPoint: (AGSPoint *)  mapPoint
forGraphic: (AGSGraphic *)  graphic
animated: (BOOL)  animated 

Show callout at specified location for a specific graphic. If the layer that the graphic belongs to contains a valid calloutDelegate (AGSHitTestable::calloutDelegate), it is given an opportunity to display information about the graphic in the callout via callout:willShowForFeature:layer:mapPoint: (AGSLayerCalloutDelegate-p) Otherwise, the callout's delegate, if it exists, is given an opportunity through via callout:willShowForFeature:layer:mapPoint: (AGSCalloutDelegate-p)

Parameters
mapPointMap point that will be used for the callout. You can pass nil if you want the center of the graphic to be used. If the graphic is represented by a marker symbol, then the mapPoint is ignored in order to best place the callout.
graphicGraphic that the callout is displaying for.
animatedDetermines whether or not the callout should animate when it is shown.
Deprecated:
Deprecated at 10.2. Use AGSCallout::showCalloutAtPoint:forFeature:animated: instead.
Since
10.1.1
- (BOOL) showCalloutForLocationDisplay

Shows the callout for the AGSLocationDisplay on the map. The callout's delegate, if it exists, is given an opportunity to display information in the callout through callout:willShowForLocationDisplay: (AGSCalloutDelegate-p)

Returns
Value indicating whether or not the callout did actually show.
Since
10.1.1

Property Documentation

- (BOOL) accessoryButtonHidden
readwritenonatomicassign

Indicates whether the accessory button is hidden. Default is NO.

Since
1.0
- (UIImage*) accessoryButtonImage
readwritenonatomicstrong

The optional image used for the accessory button.

Since
1.8
- (UIButtonType) accessoryButtonType
readwritenonatomicassign

The type of button for the accessory button.

Since
1.8
- (BOOL) autoAdjustWidth
readwritenonatomicassign

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
- (AGSColor*) borderColor
readwritenonatomicstrong

Callout's border color. Default is nil.

Since
10.2
- (CGFloat) borderWidth
readwritenonatomicassign

Callout's border width. Default is 0.

Since
10.2
- (AGSColor*) color
readwritenonatomicstrong

Background color of callout. Default is black with .8 alpha.

Since
1.0
- (CGFloat) cornerRadius
readwritenonatomicassign

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

Since
1.8
- (AGSView*) customView
readwritenonatomicstrong

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 (such as width, color, etc.) and content of the callout (such as title, detail, image, accessoryButtonImage, etc.) will be ignored.

Since
1.8
- (id<AGSCalloutDelegate>) delegate
readwritenonatomicweak

The callout's delegate.

Since
10.1.1
- (NSString*) detail
readwritenonatomiccopy

Text for detail label.

Since
1.0
- (AGSColor*) detailColor
readwritenonatomicstrong

Detail text color. Default is white.

Since
1.0
- (AGSColor*) highlight
readwritenonatomicstrong

Highlight color of callout. Default is white with .15 alpha.

Since
1.0
- (AGSImage*) image
readwritenonatomicstrong

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
readwritenonatomicassign

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
readnonatomicstrong

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 AGSLocationDisplay location update, this property contains that location.

Since
1.0
- (AGSMapView*) mapView
readnonatomicweak

The map that will display the callout.

Since
1.0
- (CGSize) margin
readwritenonatomicassign

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

Since
1.8
- (CGFloat) maxWidth
readwritenonatomicassign

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
readnonatomicassign

Point 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 shifts the callout to the right. A positive y-value shifts the callout down.

Since
1.0
Deprecated:
Deprecated at 10.2. Use AGSCallout::screenOffset instead.
- (id<AGSFeature>) representedFeature
readnonatomicstrong

The AGSFeature that the callout is shown for. Can be nil.

Since
10.2
- (AGSLayer*) representedLayer
readnonatomicstrong

The AGSLayer that the callout is shown for. Can be nil.

Since
10.2
- (AGSLocationDisplay*) representedLocationDisplay
readnonatomicstrong

The AGSLocationDisplay that the callout is shown for. Can be nil.

Since
10.2
- (id) representedObject
readnonatomicstrong

The object that the callout is shown for. Could be a feature, could be a AGSLocationDisplay.

Since
10.1.1
- (CGPoint) screenOffset
readnonatomicassign

Point 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 shifts the callout to the right. A positive y-value shifts the callout down.

Since
10.2
- (NSString*) title
readwritenonatomiccopy

Text for title label.

Since
1.0
- (AGSColor*) titleColor
readwritenonatomicstrong

Text color. Default is white.

Since
1.0
- (CGFloat) width
readwritenonatomicassign

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

Since
1.0