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)  编辑  收藏  举报

上一篇:popuptemplate的使用


下一篇:ES对某个字段分组