Difference between revisions of "Beanshell:Toggle Layer Visibility"
Jump to navigation
Jump to search
(Created page with 'The following script toggles the visibility of all layers (ie if not visible, make visible and vice versa). { import com.vividsolutions.jump.workbench.model.Layer; Iterat…') |
(No difference)
|
Latest revision as of 00:53, 12 October 2009
The following script toggles the visibility of all layers (ie if not visible, make visible and vice versa).
{
import com.vividsolutions.jump.workbench.model.Layer;
Iterator iter= wc.getLayerManager().getLayers().iterator();
while (iter.hasNext()) {
Layer layer = (Layer)iter.next();
layer.setVisible ( ! layer.isVisible());
}
}
This script will make a layer called "street" visibile.
{
import com.vividsolutions.jump.workbench.model.Layer;
Layer layer = wc.getLayerManager().getLayer("street");
if (layer != null) {
layer.setVisible(true);
}
}