原先的移动三维矢量缓存,移动端点击三维建筑显示属性信息,后来将三维矢量缓存换成osgb三维缓存,不过点击三维建筑不显示属性信息,为什么:(下面是显示属性信息代码)
class SceneTouchListener implements OnTouchListener {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case (MotionEvent.ACTION_UP): {
Layer3Ds layer3ds = mSceneControl.getScene().getLayers();
int count = layer3ds.getCount();
for (int i = 0; i < count; i++) {
Layer3D layer = layer3ds.get(i);
Selection3D selection = layer.getSelection();
if (selection.getCount() > 0) {
QueryInfoBubble queryInfoBubble = new QueryInfoBubble(MainActivity.this);
Feature3D feature =selection.toFeature3D();//转换三维数据
FieldInfos FieldInfos = layer.getFieldInfos();//三维对象属性信息集合对象
for (int j = 0; j < FieldInfos.getCount(); j++) {//三位对象属性个数
String name = FieldInfos.get(j).getName();
if (name.startsWith("SM")) {
continue;
}
String strValue;
Object value = feature.getFieldValue(name);
if (value == null) {
strValue = "";
} else {
strValue = value.toString();
}
queryInfoBubble.additem(name, strValue);
}
queryInfoBubble.show(mSceneControl, event.getX(),
event.getY());
}
}
}
break;