English

How To: Change layer visibility using the LAYERDEF tag in a GET_LAYOUT request

Summary

You can change layer visibility for a data frame within a layout by using the LAYERDEF tag within a GET_LAYOUT request.

Procedure

Refer to the following code as an example. It specifies that for the data frame "DataFrameName" the first layer is visible and the remaining layers are not visible.

Code:
<DATAFRAME id= "DataFrameName" >
 <LAYERLIST order= "true" >
  <LAYERDEF id= "0" visible= "true" />
  <LAYERDEF id= "1" visible= "false" />
  <LAYERDEF id= "2" visible= "false" />
 </LAYERLIST>
</DATAFRAME >
If you wish to turn off the first layer and make the remaining layers visible the following code would be needed.
Code:
<DATAFRAME id= "DataFrameName" >
 <LAYERLIST order= "true" >
  <LAYERDEF id= "0" visible= "false" />
  <LAYERDEF id= "1" visible= "true" />
  <LAYERDEF id= "2" visible= "true" />
 </LAYERLIST>
</DATAFRAME >
Note:
The first layer always begins with 0. Layer visibility will be defaulted as false (layers will not show) if "true" or "false" are mispelled or the LAYERDEF tag is missing for a particular layer.

Related Information