AnsweredAssumed Answered

How to disable FeatureLayer callout function

Question asked by zqkun.public@gmail.com on Apr 27, 2015
Latest reply on Apr 27, 2015 by zqkun.public@gmail.com

I am adding callout to my Map and it works fine.

 

I create a pushpin:

AGSPictureMarkerSymbol *pushpin = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:@"BluePushpin.png"];
pushpin.offset = CGPointMake(9, 16);
pushpin.leaderPoint = CGPointMake(-9, 11);

 

Then I add the callout pushpin to may callout layer

AGSPoint *theTask = [AGSPoint pointWithX:latitude y:longitude doubleValue]
                                spatialReference:self.mapView.spatialReference];
AGSGraphic graphic = [AGSGraphic graphicWithGeometry:theTask symbol:pushpin attributes:singleDataDic];
[self.taskInfoLayer addGraphic:graphic];

 

 

Everything works fine, when I tap on a pin point, it actually shows something.

 

The problem happened after I added some other layer:

NSURL *featureBldgURL = [NSURL URLWithString:LAYER_BLDG_URL];
AGSFeatureLayer *bldgLayer = [AGSFeatureLayer featureServiceLayerWithURL:featureBldgURL mode:AGSFeatureLayerModeOnDemand];
[self.mapView addMapLayer:bldgLayer withName:LAYER_BLDG_NAME];

 

Even when I tap on a place where I did not put a pushpin, it still shows up an empty callout dialog:

tmp.png

 

I found that the AGSFeatureLayer has implement AGSLayerCalloutDelegate, maybe it's the reason to show an empty callout when user tap on that AGSFeatureLayer?

 

How can I disable the callout for AGSFeatureLayer? Or, any other solution for this problem?

Outcomes