<\/HEAD>
El siguiente código funciona para screenpoint y obtiene detalles de él:- <\/P>
\/\**
<\/SPAN> * Realiza una identificación en capas en el screenpoint dado y llama a handleIdentifyResults(...) para procesarlos.
<\/SPAN> *\/<\/SPAN>
private void <\/SPAN>identifyResult(android.graphics.Point screenPoint) {
final <\/SPAN>ListenableFuture<List<IdentifyLayerResult>> identifyLayerResultsFuture = map
.identifyLayersAsync(screenPoint, 12<\/SPAN>, false<\/SPAN>, 10<\/SPAN>);
identifyLayerResultsFuture.addDoneListener(() -> {
try <\/SPAN>{
List<IdentifyLayerResult> identifyLayerResults = identifyLayerResultsFuture.get();
handleIdentifyResults(identifyLayerResults);
} catch <\/SPAN>(InterruptedException | ExecutionException e) {
Log.e("main"<\/SPAN>, "Error identificando resultados: " <\/SPAN>+ e.getMessage());
} catch <\/SPAN>(Exception e) {
e.printStackTrace();
}
});
}
\/\**
<\/SPAN> * Procesa los resultados de identificación en una cadena que se pasa a showAlertDialog(...)
<\/SPAN> *
<\/SPAN> * <\/SPAN>@param <\/SPAN>identifyLayerResults una lista de resultados de identificación generados en identifyResult().
<\/SPAN> *\/<\/SPAN>
private void <\/SPAN>handleIdentifyResults(List<IdentifyLayerResult> identifyLayerResults) {
for <\/SPAN>(IdentifyLayerResult identifyLayerResult : identifyLayerResults) {
geoElementsCountFromResult(identifyLayerResult);
}
}
\/\**
<\/SPAN> * Obtiene un conteo de los GeoElements en la capa resultado pasada
<\/SPAN> *
<\/SPAN> * <\/SPAN>@param <\/SPAN>resultado de una sola capa.
<\/SPAN> * <\/SPAN>@return <\/SPAN>el conteo total de GeoElements.
<\/SPAN> *\/<\/SPAN>
private void <\/SPAN>geoElementsCountFromResult(IdentifyLayerResult result) {
List<IdentifyLayerResult> tempResults = new <\/SPAN>ArrayList<>();
tempResults.add(result);
int <\/SPAN>index = 0<\/SPAN>;
IdentifyLayerResult identifyResult = tempResults.get(index);
if <\/SPAN>(identifyResult.getSublayerResults().size() > 0<\/SPAN>) {
String siteName = Objects.requireNonNull(identifyResult.getSublayerResults().get(index).getElements().get(index).getAttributes().get("SiteName"<\/SPAN>)).toString();
String siteCode = Objects.requireNonNull(identifyResult.getSublayerResults().get(index).getElements().get(index).getAttributes().get("SiteCode"<\/SPAN>)).toString();
getMarkerPopUp(siteName, siteCode);
}
}
En caso de obtener todos los datos de las subcapas del mapa, obtengo jsonEbeddedExcpetion.
<\/PRE><\/BODY><\/HTML>