ArcGIS Runtime SDK for iOS: AGSCallout Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSCallout Class Reference

Description

A callout window.

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.

See also
AGSCalloutDelegate
Since
100
Inheritance diagram for AGSCallout:

Instance Methods

(void) - dismiss
 
(void) - showCalloutAt:screenOffset:rotateOffsetWithMap:animated:
 
(BOOL) - showCalloutForFeature:tapLocation:animated:
 
(BOOL) - showCalloutForGraphic:tapLocation: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
 
CGSize margin
 
CGFloat maxWidth
 
id representedObject
 
CGPoint screenOffset
 
NSString * title
 
AGSColortitleColor
 
CGFloat width
 

Method Documentation

◆ dismiss

- (void) dismiss

Dismisses the callout.

Since
100

◆ showCalloutAt:screenOffset:rotateOffsetWithMap:animated:

- (void) showCalloutAt: (AGSPoint *)  mapLocation
screenOffset: (CGPoint)  screenOffset
rotateOffsetWithMap: (BOOL)  rotateOffsetWithMap
animated: (BOOL)  animated 

Shows the callout at the specified map location with the specified screen offset.

Parameters
mapLocationThe location on the map to move to.
screenOffsetThe offset from the map location to place the callout in screen points.
rotateOffsetWithMapWhether or not the screenOffset should be translated by an amount equal to the map's rotation.
animatedFlag to determine if action should be animated.
Since
100

◆ showCalloutForFeature:tapLocation:animated:

- (BOOL) showCalloutForFeature: (AGSFeature *)  feature
tapLocation: (nullable AGSPoint *)  mapTapLocation
animated: (BOOL)  animated 

Shows the callout at the specified location for the provided feature. The callout's delegate, if it exists, is informed just before the callout is shown through callout:willShowAtMapPoint: (AGSCalloutDelegate-p)

Parameters
featurefor which callout is to be shown. This then becomes the representedObject
mapTapLocationat which the callout should be shown
animatedFlag to determine if action should be animated.
Returns
Value indicating whether or not the callout did actually show.
Since
100

◆ showCalloutForGraphic:tapLocation:animated:

- (BOOL) showCalloutForGraphic: (AGSGraphic *)  graphic
tapLocation: (nullable AGSPoint *)  mapTapLocation
animated: (BOOL)  animated 

Shows the callout at the specified location for the provided graphic. The callout's delegate, if it exists, is informed just before the callout is shown through callout:willShowAtMapPoint: (AGSCalloutDelegate-p)

Parameters
graphicfor which callout is to be shown. This then becomes the representedObject
mapTapLocationat which the callout should be shown
animatedFlag to determine if action should be animated.
Returns
Value indicating whether or not the callout did actually show.
Since
100

◆ showCalloutForLocationDisplay

- (BOOL) showCalloutForLocationDisplay

Shows the callout for the AGSLocationDisplay on the map. The callout's delegate, if it exists, is informed just before the callout is shown through callout:willShowForLocationDisplay: (AGSCalloutDelegate-p)

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

Property Documentation

◆ accessoryButtonHidden

- (BOOL) accessoryButtonHidden
readwritenonatomicassign

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

Since
100

◆ accessoryButtonImage

- (UIImage*) accessoryButtonImage
readwritenonatomicstrong

The optional image used for the accessory button.

Since
100

◆ accessoryButtonType

- (UIButtonType) accessoryButtonType
readwritenonatomicassign

The type of button for the accessory button.

Since
100

◆ autoAdjustWidth

- (BOOL) autoAdjustWidth
readwritenonatomicassign

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

Since
100

◆ borderColor

- (AGSColor*) borderColor
readwritenonatomicstrong

Callout's border color. Default is lightGrayColor with 0.9 alpha.

Since
100

◆ borderWidth

- (CGFloat) borderWidth
readwritenonatomicassign

Callout's border width. Default is 0.5.

Since
100

◆ color

- (AGSColor*) color
readwritenonatomicstrong

Background color of callout. Default is whiteColor with 0.9 alpha.

Since
100

◆ cornerRadius

- (CGFloat) cornerRadius
readwritenonatomicassign

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

Since
100

◆ customView

- (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
100

◆ delegate

- (id<AGSCalloutDelegate>) delegate
readwritenonatomicweak

The callout's delegate.

Since
100

◆ detail

- (NSString*) detail
readwritenonatomiccopy

Text for detail label.

Since
100

◆ detailColor

- (AGSColor*) detailColor
readwritenonatomicstrong

Detail text color. Default is blackColor.

Since
100

◆ highlight

- (AGSColor*) highlight
readwritenonatomicstrong

Highlight color of callout. Default is nil.

Since
100

◆ image

- (AGSImage*) image
readwritenonatomicstrong

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

Since
100

◆ leaderPositionFlags

- (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
100

◆ mapLocation

- (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
100

◆ margin

- (CGSize) margin
readwritenonatomicassign

The margin in points around the text or the custom view.

Since
100

◆ maxWidth

- (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. The default value is 300.

Since
100

◆ representedObject

- (id) representedObject
readnonatomicstrong

The object that the callout is shown for. Could be a AGSFeature, AGSGraphic or AGSLocationDisplay.

Since
100

◆ screenOffset

- (CGPoint) screenOffset
readnonatomicassign

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
100

◆ title

- (NSString*) title
readwritenonatomiccopy

Text for title label.

Since
100

◆ titleColor

- (AGSColor*) titleColor
readwritenonatomicstrong

Text color. Default is blackColor.

Since
100

◆ width

- (CGFloat) width
readwritenonatomicassign

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

Since
100