<\/HEAD>
O código abaixo está funcionando para screenpoint e obtém detalhes a partir dele:- <\/P>
\/\**
<\/SPAN> * Realiza uma identificação nas camadas no screenpoint fornecido e chama handleIdentifyResults(...) para processá-las.
<\/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>, "Erro ao identificar resultados: " <\/SPAN>+ e.getMessage());
} catch <\/SPAN>(Exception e) {
e.printStackTrace();
}
});
}
\/\**
<\/SPAN> * Processa os resultados da identificação em uma string que é passada para showAlertDialog(...)
<\/SPAN> *
<\/SPAN> * <\/SPAN>@param <\/SPAN>identifyLayerResults uma lista de resultados de identificação gerados em identifyResult().
<\/SPAN> *\/<\/SPAN>
private void <\/SPAN>handleIdentifyResults(List<IdentifyLayerResult> identifyLayerResults) {
for <\/SPAN>(IdentifyLayerResult identifyLayerResult : identifyLayerResults) {
geoElementsCountFromResult(identifyLayerResult);
}
}
\/\**
<\/SPAN> * Obtém a contagem dos GeoElements na camada de resultado passada
<\/SPAN> *
<\/SPAN> * <\/SPAN>@param <\/SPAN>resultado de uma única camada.
<\/SPAN> * <\/SPAN>@return <\/SPAN>a contagem 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);
}
}
No caso de obter todos os dados das subcamadas do mapa, estou recebendo jsonEbeddedExcpetion.
<\/PRE><\/BODY><\/HTML>