像这种点击前是正常显示设置的样式:
点击之后就是选择的样式:
点击事件怎么监听?
该链接为11i示例代码与数据下载地址,您可以下载后打开里面的oSGBLayerAttributeQuery;具体位置为‘SampleCode\SampleCode_AndroidStudio\AndroidStudioSampleCode’下面的就是该范例;http://download.supermap.com.cn/2022/SuperMap_11i_2022_SP1/iMobile/supermap-imobile-11.0.1-232-android-zip-chs_(%E7%A4%BA%E8%8C%83%E4%BB%A3%E7%A0%81%E4%B8%8E%E7%A4%BA%E8%8C%83%E6%95%B0%E6%8D%AE).zip
// 属性查询时的矢量数据 public static void vect(Selection3D selection, Layer3D layer, FieldInfos fieldInfos, QueryInfoBubblePopupWindow queryInfoBubble) { Feature3D feature = null; Layer3DOSGBFile layer3d = null; if (layer.getType() == Layer3DType.OSGBFILE) { layer3d = (Layer3DOSGBFile) layer; } else if (layer.getType() == Layer3DType.VECTORFILE) { feature = selection.toFeature3D(); } int count = fieldInfos.getCount(); if (count > 0) { Object[] str = layer3d.getAllFieldValueOfLastSelectedObject(); if (str == null) { return; } for (int j = 0; j < count; j++) { String name = fieldInfos.get(j).getName(); String strValue; Object value; if (feature == null) { value = str[j]; } else { value = feature.getFieldValue(name); } if (value.equals("NULL")) { strValue = ""; } else { strValue = value.toString(); } queryInfoBubble.additem(name + ":", strValue); } }
这段代码不是判断Layer3D的type,然后拿取对象的信息,但是只有OSGBFILE和VECTORFILE这两种类型啊,我想查询的是KML类型的对象信息。尝试拿到
selection然后toFeature3D()会报错
com.supermap.realspace.Layer3DKML cannot be cast to com.supermap.realspace.Layer3DVectorFile
所以我想问的是KML类型的对象信息怎么拿?