Select to view content in your preferred language

Why Would -[AGSCallout showCalloutAtPoint:forFeature:layer:animated:] Fail?

2487
1
Jump to solution
02-20-2014 04:47 PM
KristopherJohnson
Deactivated User
I have an AGSGraphicLayer displaying AGSGraphic instances. I have the callout delegate set for both the map view and the layer, and the delegate function returns YES. The callout displays fine if I tap on a graphic. But if I try to programmatically display the callout using -[AGSCallout showCalloutAtPoint:forFeature:layer:animated:], it returns NO (failure) and no callout is shown.

I'm pretty sure all the arguments I'm passing to the method are valid.

Under what circumstances would this method return NO? Are there any specific attributes or properties that need to be set on the graphic, the layer, or the map view to get it to work?

Thanks,
-- Kris
0 Kudos
1 Solution

Accepted Solutions
KristopherJohnson
Deactivated User
Well, maybe this is a documentation issue...

The docs for showCalloutAtPoint:forFeature:layer:animated: (https://developers.arcgis.com/ios/api-reference/interface_a_g_s_callout.html) say that for the mapPoint parameter ". . . 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."

I was passing nil, because I wanted the feature's center to be used, and my graphic has a marker symbol, so the parameter should supposedly be ignored anyway. But if I pass graphic.geometry (which is an AGSPoint) instead of nil, then the callout is shown and the method returns YES.

So problem solved, I guess, but is this a problem with the docs or am I not interpreting them correctly?

View solution in original post

0 Kudos
1 Reply
KristopherJohnson
Deactivated User
Well, maybe this is a documentation issue...

The docs for showCalloutAtPoint:forFeature:layer:animated: (https://developers.arcgis.com/ios/api-reference/interface_a_g_s_callout.html) say that for the mapPoint parameter ". . . 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."

I was passing nil, because I wanted the feature's center to be used, and my graphic has a marker symbol, so the parameter should supposedly be ignored anyway. But if I pass graphic.geometry (which is an AGSPoint) instead of nil, then the callout is shown and the method returns YES.

So problem solved, I guess, but is this a problem with the docs or am I not interpreting them correctly?
0 Kudos