Doubleclick needed for showing callout on identify

367
1
06-09-2011 02:18 AM
ReneNijkamp
New Contributor
Hi,

I'm using an identifylayer, with the controller. The identify itself works, the object is highlighted with a color, but...
I have to tap the object twice before the callout is shown.

So, summarized:
First tap: Object is selected (Highlighted)
Second tap: Callout is shown

I want to skip the second step, but i have no idea how. I looked into the class reference, but... couldn't find anything...

The code I use:
- (void)mapView:(AGSMapView *)mapView didClickAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint graphics:(NSDictionary *)graphics {
 self.identifyParams.tolerance = 7;
 self.identifyParams.geometry = mappoint;
 self.identifyParams.size = mapViewController.mapView.bounds.size;
 self.identifyParams.mapEnvelope = mapViewController.mapView.envelope;
 self.identifyParams.returnGeometry = YES;
 self.identifyParams.layerOption = AGSIdentifyParametersLayerOptionAll;
 self.identifyParams.spatialReference = mapViewController.mapView.spatialReference;
    
    
 //execute the task
 [self.identifyTask executeWithParameters:self.identifyParams];
} 

//results are returned
- (void)identifyTask:(AGSIdentifyTask *)identifyTask operation:(NSOperation *)op didExecuteWithIdentifyResults:(NSArray *)results {
    //clear previous results
    [mapViewController.identifyLayer removeAllGraphics];
    _identifyInfoTemplate = [[IdentifyInfoTemplate alloc] init];
    
    for (AGSIdentifyResult* result in results) {
        result.feature.symbol = [self determineAndReturnSymbol:AGSGeometryTypeForGeometry(result.feature.geometry)];
        result.feature.infoTemplateDelegate = _identifyInfoTemplate;
        
        [mapViewController.identifyLayer addGraphic:result.feature];
    }
    
    //call dataChanged on the graphics layer to redraw the graphics
    [mapViewController.identifyLayer dataChanged]; 
    
    
}

0 Kudos
1 Reply
NimeshJarecha
Esri Regular Contributor
The last post of the following forum thread has sample code you are looking for.

http://forums.arcgis.com/threads/7719-Identify-Example

Hope this helps!

Regards,
Nimesh
0 Kudos