arcgis - 想要使用 ArcGIS Runtime API for Andriod 仅在现有图形叠加层中显示第一个结果
问题描述
我目前正在使用 ESRI 地理编码服务创建定位器任务的 android 平台,并将地址传递给地理编码。
操作完成后,将检索结果位置并将其显示在图形叠加中。
我有多个输出,但我想在地图上显示第一个结果。
下面是我的代码,有没有办法改进我的代码以仅在加载时显示第一个结果而忽略休息。使过程更快。
final LocatorTask onlineLocator = new LocatorTask("https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer");
final ListenableFuture> geocodeFuture = onlineLocator.geocodeAsync("380 New York Street, Redlands, CA");
geocodeFuture.addDoneListener(new Runnable() {
@Override
public void run() {
try {
// Get the results of the async operation
List geocodeResults = geocodeFuture.get();
}
catch (InterruptedException | ExecutionException e) {
dealWithException(e); // deal with exception appropriately...
}
}
});
解决方案
推荐阅读
- leaflet - 传单从 MYSQL 的数据构建多边形
- python - ValueError:形状(240000,28,28)和(2,512)未对齐:28(dim 2)!= 2(dim 0)
- python - 如何阅读 discord.py 中的消息内容?
- python - 如何使用 dict 优化我的代码?
- firebase - 如何检查文档是否存在于flutter中?
- openmp - 运行的 OpenMP 线程比通过 omp_set_num_threads() 设置的线程多?
- format - 如何在 Octave 中格式化复制和粘贴
- sql - 依靠一列并按另一列分组
- size - 我的移动响应代码在桌面屏幕上显示时太大
- python - 为什么没有按照 replace() 语句替换所有反斜杠?