对三维场景中的图层设置过滤显示后,刷新场景,场景不会发生变化,需要手动把三维地球缩放到很小,再放大时才会显示出设置的效果。
另外,大数据时,设置图层过滤显示,无论地图还是场景好像并不会提示显示性能。
public static void SetFilterByAddvcdForScene(Scene scene,string addvcd)
{
foreach (Layer3D layer3D in scene.Layers)
{
//设置图层显示过滤条件
string attributeFilter = string.Empty;
if (addvcd != null && !string.IsNullOrEmpty(addvcd))
{
attributeFilter = string.Format("{0}={1}", ClsFieldMapping.addvcd, addvcd);
}
QueryParameter queryParameter = new QueryParameter();
queryParameter.AttributeFilter = attributeFilter;
if (layer3D is Layer3DDataset)
{
(layer3D as Layer3DDataset).DisplayFilter = queryParameter;
}
}
scene.Refresh();
}