浏览器版本低!无法浏览完整内容,建议升级或更换浏览器。

文档全面上新

更科技的视觉体验,更高效的页面结构,快前往体验吧!

体验新版


AR探索

Android AR识别SDK可以结合地图SDK检索功能实现周边探索,开发者调用此功能前需要一起下载地图SDK检索功能,并根据要求进行集成配置,然后调用SDK检索功能,等待返回相关数据后,用Android AR识别SDK进行展示。集成地图SDK检索功能方法请参见检索相关文档;以下重点展示请求数据和返回数据调用Android AR识别SDK的方法。
示例代码如下:

// 调用检索SDK方法,获取检索数据
searchNearbyProcess();
// 实现检索数据监听OnGetPoiSearchResultListener,终点

@Override
public void onGetPoiResult(PoiResult result) {
  
    if (result.error == SearchResult.ERRORNO.NO_ERROR) {
        poiInfos = new ArrayList<PoiInfoImpl>();
// 对检索返回数据进行包装,并掉转到展示Activity
        for (PoiInfo poi : result.getAllPoi()) {
            ArPoiInfo poiInfo = new ArPoiInfo();
            ArLatLng arLatLng = new ArLatLng(poi.location.latitude, poi.location.longitude);
            poiInfo.name = poi.name;
            poiInfo.location = arLatLng;
            PoiInfoImpl poiImpl = new PoiInfoImpl();
            poiImpl.setPoiInfo(poiInfo);
            poiInfos.add(poiImpl);
        }
        Toast.makeText(this, "查询到: " + poiInfos.size() + " ,个POI点", Toast.LENGTH_SHORT).show();
        Intent intent = new Intent(MainActivity.this, ArActivity.class);
        MainActivity.this.startActivity(intent);
        return;
    }
    if (result.error == SearchResult.ERRORNO.AMBIGUOUS_KEYWORD) {

        // 当输入关键字在本市没有找到,但在其他城市找到时,返回包含该关键字信息的城市列表
        String strInfo = "在";
        for (CityInfo cityInfo : result.getSuggestCityList()) {
            strInfo += cityInfo.city;
            strInfo += ",";
        }
        strInfo += "找到结果";
        Toast.makeText(this, strInfo, Toast.LENGTH_LONG)
                .show();
    }
}

效果展示如下:
explore2.jpg

  • 文档根本没法用

  • 文档水平很差

  • 文档水平一般

  • 文档不错

  • 文档写的很好

如发现文档错误,或对此文档有更好的建议,请在下方反馈。问题咨询请前往反馈平台提交工单咨询。

提交反馈

拖动标注工具

添加矩形标注

添加箭头标注

完成

取消