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

文档全面上新

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

体验新版
(清空页面)
 
第1行: 第1行:
{{androidarsdk-sidebar}}
 
  
== 自定义目标 ==
 
 
Android AR识别SDK支持开发者自定义坐标点和自定义名称在屏幕上展示,Android AR识别SDK会根据用户传递的坐标信息以及本地的定位信息计算出坐标点在本地位置的方位,再根据开发者上传的名字信息进行显示。<br/>a) 开发者可根据如下代码显示一个单点数据;
 
 
示例代码如下:
 
<pre class="prettyprint codestyle">//1、ArLatLng类用于开发者自定义的目标点信息,传递经纬度
 
ArLatLng arLatLng = new ArLatLng(40.082545, 116.376188);
 
//2、 ArPoiInfo类用于开发者传递经纬度ArLatLng对象和自定义名称
 
ArPoiInfo poiInfo = new ArPoiInfo();
 
//3、 PoiInfoImpl类用于ArPoiInfo对象的存储
 
PoiInfoImpl poiImpl = new PoiInfoImpl();
 
//4、最后在ArActivity的SimpleSensor.OnHoldPositionListener 传感器监听类中传递给mCamGLView中进行显示,调用方法:
 
mCamGLView.setFindArSensorState(remapValue, getLayoutInflater(), mArPoiItemRl, ArActivity.this, poiInfos, ArActivity.this);
 
</pre>
 
 
效果展示如下:<br/>http://mapopen-pub-androidsdk.cdn.bcebos.com/ar/images/singlepoint2.jpg
 
 
<br/>b) Android AR识别SDK支持传递多坐标点和自定义名称(同自定义单点)在屏幕上展示, Android AR识别SDK会根据用户上传显示多个自定义点,由于手机屏幕限制,一竖排最多能展示7个目标点,自定义目标点最多可展示15个;<br/>示例代码如下:
 
<pre class="prettyprint codestyle">  //1、ArLatLng类用于开发者自定义多个目标点信息,传递经纬度
 
    private ArLatLng[] latLngs = {new ArLatLng(40.082545, 116.376188), new ArLatLng(40.04326, 116.376781),
 
                new ArLatLng(40.043204, 116.300784)...}
 
    //2、遍历多目标点信息,存储到PoiInfoImpl对象中
 
    poiInfos = new ArrayList<PoiInfoImpl>();
 
                    int i = 0;
 
                    for (ArLatLng all&nbsp;: latLngs) {
 
                        ArPoiInfo pTest = new ArPoiInfo();
 
                        pTest.name = "testPoint" + i++;
 
                        pTest.location = all;
 
                        PoiInfoImpl poiImplT = new PoiInfoImpl();
 
                        poiImplT.setPoiInfo(pTest);
 
                        poiInfos.add(poiImplT);
 
                    }
 
    //3、最后在ArActivity的SimpleSensor.OnHoldPositionListener 传感器监听类中传递给mCamGLView中进行显示,调用方法:
 
    mCamGLView.setFindArSensorState(remapValue, getLayoutInflater(),mArPoiItemRl, ArActivity.this, poiInfos, ArActivity.this);
 
</pre>
 
 
效果展示如下:<br/>http://mapopen-pub-androidsdk.cdn.bcebos.com/ar/images/points2.jpg
 

2022年5月17日 (二) 15:14的最后版本

  • 文档根本没法用

  • 文档水平很差

  • 文档水平一般

  • 文档不错

  • 文档写的很好

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

提交反馈

拖动标注工具

添加矩形标注

添加箭头标注

完成

取消