其他分享
首页 > 其他分享> > arcgis andriod 长按获得当前信息

arcgis andriod 长按获得当前信息

作者:互联网

arcgis andriod 长按获得当前信息

 //      长按显示鼠标点坐标及比例尺
    private class myLongPressListener implements OnLongPressListener {
        private static final long serialVersionUID = 1L;

        @Override
        public boolean onLongPress(float x, float y) {


            if (pFeatureLayer != null) {
                pFeatureLayer.clearSelection();

                //执行选择查询操作
                long[] pLong = pFeatureLayer.getFeatureIDs(x, y, 10);
                if (pLong.length > 0) {
                    Feature pFeature = pFeatureLayer.getFeature(pLong[0]);
                    List<com.esri.core.map.Field> pList = pFeatureLayer.getFeatureTable().getFields();
                    String str = "";
                    int num = pList.size();
                    for (int j = 0; j < num; j++) {
                        String FieldName = pList.get(j).getName();
                        str = str + "字段:" + FieldName + ",值:" + pFeature.getAttributeValue(FieldName).toString();
                        if (j < num - 1) {
                            str = str + "\n";
                        }
                    }
                    pFeatureLayer.selectFeature(pFeature.getId());
                    ShowMessage(str);
                }
            }
}

 

posted on 2016-03-07 16:09  gisoracle  阅读(374)  评论(0)  编辑  收藏  举报

标签:当前,andriod,arcgis,pFeature,num,FieldName,str,pFeatureLayer,pList
来源: https://blog.51cto.com/u_12139363/3030613