- (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]; }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.