LAYER  Examples

Used in:  CONFIG   REQUEST   RESPONSE  
Servers:  Image   Query   Feature   Extract   Geocode   ArcMap  
Parent elements:  GET_EXTRACT   GET_FEATURES   GET_GEOCODE   GET_IMAGE   LAYERS   MAP  

<LAYER Attribute Description Table


     When parent element is GET_FEATURES, GET_GEOCODE:
     id ="string"

     When parent element is LAYERS in a GET_IMAGE request or map configuration file:
     id ="string"

     When parent element is LAYERS in an IMAGE response:
     featurecount ="string"
     id ="string"
     name ="string"

     When parent element is MAP, GET_IMAGE, GET_EXTRACT:
     id ="string"
     type ="featureclass | acetate | image"
     maxscale ="string"
     minscale ="string"
     name ="string"
     visible ="true | false"  [true]
>


     When parent element is GET_FEATURES, GET_GEOCODE:
          No Child Elements

     When parent element is GET_IMAGE and LAYER type="featureclass" or "image" - ArcMap Server:
     <DATASET... />
     <QUERY... />  [Either SPATIALQUERY or QUERY but not both]
     <SPATIALQUERY... />  [Either SPATIALQUERY or QUERY but not both]

     When parent element is LAYERS:
          No Child Elements

     When parent element is MAP or GET_IMAGE and LAYER type="acetate" - Image and ArcMap Servers:
     (m) <OBJECT... />

     When parent element is MAP or GET_IMAGE and LAYER type="image" - Image Server:
     <DATASET... />
     <COORDSYS... />
     <IMAGEPROPERTIES... />
     <RASTER_RENDERER... />  [Only valid with MAP]

     When parent element is MAP, GET_IMAGE, or GET_EXTRACT and LAYER type="featureclass" - Image and Extract Servers:
     <DATASET... />
     <COORDSYS... />
     <DENSIFY... />
     <QUERY... />  [Either SPATIALQUERY or QUERY but not both]
     <SPATIALQUERY... />  [Either SPATIALQUERY or QUERY but not both]
     (m) <EXTENSION... />  [Only valid with MAP]
     <GROUPRENDERER... />  [Or]
     <SCALEDEPENDENTRENDERER... />  [Or]
     <SIMPLELABELRENDERER... />  [Or]
     <SIMPLERENDERER... />  [Or]
     <VALUEMAPLABELRENDERER... />  [Or]
     <VALUEMAPRENDERER... />  [Or]

</LAYER >
Bold: Attribute or child element is required.
(m):  Child element can be used multiple times.


Description:


Restrictions:


Notes:


Attribute Descriptions for LAYER:


When parent element is GET_FEATURES, GET_GEOCODE:
Attribute Usage Back to Top
id ID as specified in map configuration file. For a request to be valid, the ID used in the request must have a match in the map configuration file.

When parent element is LAYERS in a GET_IMAGE request or map configuration file:
Attribute Usage Back to Top
id ID as specified in map configuration file or the request. For a legend list to be valid, the ID used must have a match in the map configuration file or the request.

When parent element is LAYERS in an IMAGE response:
Attribute Usage Back to Top
featurecount For shapefile and ArcSDE layers, counts the number of features shown on the map. For image layers, counts the number of images present in the map. For acetate layers, counts the number of times OBJECT is used in a layer.
id ID as specified in map configuration file or request.
name Name as specified in map configuration file or request.

When parent element is MAP, GET_IMAGE, GET_EXTRACT:
Attribute Usage Back to Top
id Unique ID for a layer. The ID can be any combination of alpha and numeric characters. If used in a request to extract data, the characters must be in English and valid for a filename unless the extract EXTENSION for the layer is used.
maxscale Maximum scale to display map using a relative scale such as 1:24000. Scale can also be calculated as the number of map units per pixel.
minscale Minimum scale to display map using a relative scale such as 1:24000. Scale can also be calculated as the number of map units per pixel.
name Layer name. Can be an alias.
type Specifies layer type. Use "featureclass" for shapefiles and ArcSDE vector layers. Use "image" for raster image files, GRIDs, and ArcSDE raster layers. Use "acetate" for adding graphics on top of the map.
visible Specifies layer visibility.
 

Examples for LAYER:

Example 1: When in CONFIG. 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="-178.21" miny="18.92" maxx="-66.96" maxy="71.41" 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="CITIES" visible="true" id="2">
      <DATASET name="CITIES" type="point" workspace="shp_ws-0" />
      <SIMPLERENDERER>
        <SIMPLEMARKERSYMBOL type="square" width="5" />
      </SIMPLERENDERER>
      </LAYER>
    </MAP>
  </CONFIG>
</ARCXML>

Example 2: Map configuration file where layers with ID of "0" and "1" are removed from the legend list. 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 dynamic="true" >
      <PROPERTIES>
      <ENVELOPE minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0" name="Initial_Extent" />
      <MAPUNITS units="decimal_degrees" />
      <FILTERCOORDSYS id="4326" />
      <FEATURECOORDSYS id="4326"/>
      <LEGEND title="Legend" font="Arial" autoextend="true" columns="1" width="170" height="300" backgroundcolor="255,255,0" >
        <LAYERS>
          <LAYER id="0"/>
          <LAYER id="1"/>
        </LAYERS>
      </LEGEND>
      </PROPERTIES>
      <WORKSPACES>
        <SHAPEWORKSPACE name="shp_ws-0" directory="<path to WORLD ESRIDATA>" />
        <SHAPEWORKSPACE name="shp_ws-2" directory="<path to USA ESRIDATA>" />
        <SHAPEWORKSPACE name="shp_ws-3" directory="<path to CANADA ESRIDATA>" />
      </WORKSPACES>
      <LAYER type="featureclass" name="WORLD30" visible="true" id="0">
        <DATASET name="WORLD30" type="polygon" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="0,153,255" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="CNTRY94" visible="true" id="1">
        <DATASET name="CNTRY94" type="polygon" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="255,255,153" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="United States" visible="true" id="2">
        <DATASET name="STATES" type="polygon" workspace="shp_ws-2" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="255,0,0" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="Canada" visible="true" id="3">
        <DATASET name="province" type="polygon" workspace="shp_ws-3" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="0,153,0" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="World Cities" visible="true" id="4">
        <DATASET name="CITIES" type="point" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEMARKERSYMBOL color="102,0,102" width="8.0" />
        </SIMPLERENDERER>
      </LAYER>
    </MAP>
  </CONFIG>
</ARCXML>

Example 3: When used with LAYERS to remove layers with ID of "0" and "1" from the legend list. Back to Top
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_IMAGE>
      <PROPERTIES>
        <LEGEND title="Legend" font="Arial" autoextend="true" columns="1" width="170" height="300" backgroundcolor="255,255,0" >
          <LAYERS>
            <LAYER id="0"/>
            <LAYER id="1"/>
          </LAYERS>
        </LEGEND>
        <DRAW map="false"/>
      </PROPERTIES>
    </GET_IMAGE>
  </REQUEST>
</ARCXML>

Example 4: Identifying a layer by its ID in a GET_FEATURES request. Back to Top
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
<REQUEST>
  <GET_FEATURES featurelimit="25" beginrecord="0" outputmode="xml" geometry="false" envelope="true" compact="true">
    <LAYER id="4" />
    <SPATIALQUERY subfields="#ALL#" where="NAME  =  'Los Angeles'" >
    </SPATIALQUERY>
  </GET_FEATURES>
</REQUEST>
</ARCXML>

Example 5: IMAGE response showing details on layers in the requested ArcIMS service. Back to Top
<?xml version="1.0" encoding="UTF8"?>  
<ARCXML version="1.1">  
  <RESPONSE>  
    <IMAGE>  
      <ENVELOPE minx="-180" miny="-135" maxx="180" maxy="135" />  
      <LAYERS>  
        <LAYER name="CNTRY94" id="0" featurecount="165" />  
        <LAYER name="STATES" id="1" featurecount="51" />  
        <LAYER name="province" id="2" featurecount="12" />  
      </LAYERS>  
      <OUTPUT file="c:\arcims\output\world_MYCOMPUTER3633699.jpg" url="http://mycomputer.domain.com/output/world_MYCOMPUTER3633699.jpg" />  
    </IMAGE>  
  </RESPONSE>  
</ARCXML>