I'm having issues with the identifyLayers function. Every time I call it, i consistently get back the same result. For example the same information is coming back whether I click on a different part of the screen or not. It generally is whatever the first result was that came back out of the function. I've followed the sample code available out of the samples app on the app store, but cannot get it to work. I'm using the most recent version of the SDK. Below is the code that I'm calling.
func geoView(_ geoView: AGSGeoView, didTapAtScreenPoint screenPoint: CGPoint, mapPoint: AGSPoint) {
self.identifyLayers(screenPoint)
}
private func identifyLayers(_ screen: CGPoint) {
let passedInLayer: AGSLayer = self.layer
print(screen)
self.mapsView.identifyLayer(passedInLayer, screenPoint: screen, tolerance: 12, returnPopupsOnly: false, maximumResults: 10) { (identifyLayerResult: AGSIdentifyLayerResult) -> Void in
if let error = identifyLayerResult.error {
print(error)
return
}
self.handleIdentifyResults(identifyLayerResult)
}
}
private func handleIdentifyResults(_ results: AGSIdentifyLayerResult) {
print(results.layerContent.name)
print(results.sublayerResults.count)
print(results.sublayerResults[0].layerContent.name)
print(results.sublayerResults[0].geoElements.count)
print(results.sublayerResults[0].geoElements[0].attributes["ParcelFormatted"])
}
All of this code ends returning the same value for the ParcelFormatted field out of the layer.
Thanks in advance for your help.
Greg