LAYERDEF  Examples

Used in:  CONFIG   REQUEST  
Servers:  Image   Extract   ArcMap  
Parent elements:  LAYERLIST   OVERVIEWMAP  

<LAYERDEF Attribute Description Table


     When parent element is LAYERLIST in GET_IMAGE, GET_LAYOUT, or GET_EXTRACT request:
     id ="string"
     name ="string"
     visible ="true | false"

     When parent element is OVERVIEWMAP in a viewer configuration file:
     name ="string"
>


     When parent element is LAYERLIST in GET_EXTRACT request:
     <QUERY... />  [Either SPATIALQUERY or QUERY but not both]
     <SPATIALQUERY... />  [Either SPATIALQUERY or QUERY but not both]

     When parent element is LAYERLIST in GET_IMAGE request - ArcMap Server:
     <QUERY... />  [Either SPATIALQUERY or QUERY but not both]
     <SPATIALQUERY... />  [Either SPATIALQUERY or QUERY but not both]

     When parent element is LAYERLIST in GET_IMAGE request - Image Server:
     <QUERY... />  [Either SPATIALQUERY or QUERY but not both]
     <SPATIALQUERY... />  [Either SPATIALQUERY or QUERY but not both]
     <GROUPRENDERER... />  [Or]
     <SCALEDEPENDENTRENDERER... />  [Or]
     <SIMPLELABELRENDERER... />  [Or]
     <SIMPLERENDERER... />  [Or]
     <VALUEMAPLABELRENDERER... />  [Or]
     <VALUEMAPRENDERER... />  [Or]

     When parent element is LAYERLIST in GET_LAYOUT request - ArcMap Server:
          No Child Elements

     When parent element is OVERVIEWMAP in a viewer configuration file:
          No Child Elements

</LAYERDEF >
Bold: Attribute or child element is required.


Description:


Restrictions:


Notes:


Attribute Descriptions for LAYERDEF:


When parent element is LAYERLIST in GET_IMAGE, GET_LAYOUT, or GET_EXTRACT request:
Attribute Usage Back to Top
id Reference to unique layer ID as defined in map configuration file or in a dynamic layer in the request.
name Reference to layer name as defined in map configuration file or in a dynamic layer in the request.
visible Turns layer on or off. When using the Image Server, the default for visible is as it is defined in the map configuration file in all cases. When using the ArcMap Server and LAYERLIST order="false", the default for visible is as it is defined in the ArcMap document. However, when LAYERLIST order="true", the default for LAYERDEF visible is "false", even if the layer is visible in the ArcMap document. Therefore, you must explicitely set visible to "true" if you want the layer to be displayed.

When parent element is OVERVIEWMAP in a viewer configuration file:
Attribute Usage Back to Top
name Reference to layer name.
 

Examples for LAYERDEF:

Example 1: When in a GET_IMAGE request. Back to Top
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <REQUEST>
  <GET_IMAGE>
    <PROPERTIES>
      <LAYERLIST>
        <LAYERDEF id="1">
          <SIMPLERENDERER>
            <SIMPLEMARKERSYMBOL width="16" color="0,0,0" />
          </SIMPLERENDERER>
         <SPATIALQUERY>
            <SPATIALFILTER relation="area_intersection">      
            <ENVELOPE maxy="60" maxx="60" miny="0" minx="0" />
         </SPATIALFILTER>
         </SPATIALQUERY>
      </LAYERDEF>
      </LAYERLIST>
      <ENVELOPE minx="-180" miny="-90" maxx="180" maxy="90" />
   </PROPERTIES>
  </GET_IMAGE>
  </REQUEST>
</ARCXML>

Example 2: When used in OVERVIEWMAP. Back to Top
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <CONFIG>
    <ENVIRONMENT>
      <LOCALE country="US" language="en" variant="" />
      <UIFONT color="0,0,0" name="Arial" size="12" style="regular" />
      <SCREEN dpi="96" />
    </ENVIRONMENT>
    <MAP>
      <PROPERTIES>
      <ENVELOPE minx="-116.016078" miny="36.252371" maxx="-100.855887" maxy="46.622450" name="Initial_Extent" />
      <MAPUNITS units="decimal_degrees" />
      <FILTERCOORDSYS id="4326" />
      <FEATURECOORDSYS id="4326"/>
      </PROPERTIES>
      <WORKSPACES>
      <SHAPEWORKSPACE name="shp_ws-0" directory="<path to USA ESRIDATA>" />
      </WORKSPACES>
      <LAYER type="featureclass" name="STATES" visible="true" id="0">
      <DATASET name="STATES" type="polygon" workspace="shp_ws-0" />
      <SIMPLERENDERER>
        <SIMPLEPOLYGONSYMBOL fillcolor="255,0,0" />
      </SIMPLERENDERER>
      </LAYER>
    </MAP>
    <OVERVIEWMAP backgroundcolor="255,255,255" framefillcolor="255,0,0" frameoutlinecolor="255,0,0" zoomfactor="4.0">
      <LAYERDEF name="STATES" />
    </OVERVIEWMAP>
  </CONFIG>
</ARCXML>

Example 3: When used in GET_LAYOUT Back to Top
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_LAYOUT>
      <DATAFRAME id="Mexico">
       <LAYERLIST order="true">
         <LAYERDEF id="2" visible="false" />
         <LAYERDEF id="1" visible="false" />
         <LAYERDEF id="0" visible="true" />
       </LAYERLIST>
      </DATAFRAME>
    </GET_LAYOUT>
  </REQUEST>
</ARCXML>