/**
* 获取场景中所有模型或者Featrue的信息
*/
function getFeatureInfos(){
var layer3Ds = scene.get_layer3Ds();
var layer3Ds_count = layer3Ds.get_count();
console.log("场景具有的图层总数: " + layer3Ds_count);
for(var i = 0; i < layer3Ds_count; i++){
var layer3D = layer3Ds.get_item(i);
var layerName = layer3D.get_dataName();
console.log("图层i: " + i + " 的图层名: " + layerName);
var feature3Ds = layer3D.get_feature3Ds();
var feature3Ds_count = 0;
if(feature3Ds !== null){
feature3Ds_count = feature3Ds.get_count();
console.log("图层名为: " + layerName + " 包含的feature3D的总数 feature3Ds_count : " + feature3Ds_count);
}else{
console.log("图层名为: " + layerName + " 包含的feature3D的总数为 0。");
}
}
}
plugin 三维开发,OSGB场景缓存,尝试获取场景中图层中的所有Features失败,每次
var feature3Ds = layer3D.get_feature3Ds();
都是null,求指点。