如何从WorldWind的图层面板中隐藏(或删除)预先配置的图层 [英] How to hide (or remove) a pre-configured layer from the layers-panel in WorldWind
本文介绍了如何从WorldWind的图层面板中隐藏(或删除)预先配置的图层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在图层"面板中隐藏标准"图层之一(例如,星星,大气层,美国航空航天局蓝色大理石等),并仅通过我自己添加的图层来可视化并使之启用/禁用.自然,隐藏层必须始终处于活动状态.有可能吗?
I would like to hide one of the "standard" layers (such as Stars, atmosphere, nasa blue marble and so on) in the layer panel, and to visualize and to make enabled/disabled by ticks only layers added by me. Naturally, the hidden layers have to be always active. Is it possible?
推荐答案
您可以添加此方法.
private void removeLayerWithName(String str) {
wwd.getModel().getLayers().forEach(layer -> {
if (layer.getName().equals(str)) {
wwd.getModel().getLayers().remove(layer);
return;
}
});
}
,并且在您的代码中将其称为removeLayerWithName("Stars");
.
and in your code you call it as removeLayerWithName("Stars");
.
可能对您有用的其他图层名称:
Other layer-names that may be useful for you:
- 星星
- 大气
- NASA蓝色大理石图像
- 蓝色大理石2004年5月
- i-cubed Landsat
这篇关于如何从WorldWind的图层面板中隐藏(或删除)预先配置的图层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文