码迷,mamicode.com
首页 > 其他好文 > 详细

arcgis andriod 长按获得当前信息

时间:2016-03-07 17:05:02      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

 //      长按显示鼠标点坐标及比例尺
    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);
                }
            }
}

 

arcgis andriod 长按获得当前信息

标签:

原文地址:http://www.cnblogs.com/gisoracle/p/5250902.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!