LEGEND  Examples

Used in:  CONFIG   REQUEST   RESPONSE  
Parent elements:  IMAGE   PROPERTIES  

<LEGEND Attribute Description Table


     When parent element is IMAGE:
     file ="string"
     url ="string"

     When parent element is PROPERTIES:
     anitaliasing ="true | false"  [true]
     autoextend ="true | false"  [false]
     backgroundcolor ="0,0,0 - 255,255,255"
     cansplit ="true | false"  [false]
     cellspacing ="integer"  [2]
     columns ="integer"  [1]
     display ="true | false"  [true]
     font ="Any system font"  [Arial]
     height ="1 - NNN"  [300]
     layerfontsize ="integer"  [10]
     reverseorder ="true | false"  [false]
     splittext ="string"  [(cont)]
     swatchheight ="integer"  [14]
     swatchwidth ="integer"  [18]
     title ="string"
     titlefontsize ="integer"  [12]
     transcolor ="0,0,0 - 255,255,255"
     valuefontsize ="integer"  [8]
     width ="1 - NNN"  [125]
>

     No child elements
</LEGEND >
Bold: Attribute or child element is required.


Description:


Restrictions:


Notes:


Attribute Descriptions for LEGEND:


When parent element is IMAGE:
Attribute Usage Back to Top
file Full pathname and filename for location of legend image generated by the ArcIMS Spatial Server. Image is written to the ArcIMS Spatial Server's output directory by default. UNC pathnames are valid (\\myComputer\arcims\output).
url URL used by client to retrieve legend image.

When parent element is PROPERTIES:
Attribute Usage Back to Top
anitaliasing Used to make edges of labels and symbols smoother. When set to true, antialiasing is active. Note that the time to generate a map may significantly increase when antialiasing is turned on.
autoextend If true, automatically extends legend vertically past size specified in height, if needed.
backgroundcolor Legend’s background color using RGB values.
cansplit Allows splitting of valuemap layers between columns.
cellspacing Defines number of pixels to pad between entries.
columns Defines number of columns in legend.
display Turns legend on or off.
font Font for title. The name is case sensitive. If font name uses "&", use "&amp;" instead. For example, ESRI Transportation & Civic should be written as ESRI Transportation &amp; Civic. For Feature MapServices, the font must reside on the client machine or else the system default font is used.
height Legend height in pixels.
layerfontsize Font size for layer labels.
reverseorder Reverse order of layers.
splittext Text that displays in bottom of a column if a valuemap is carried over into the next column.
swatchheight Height of the symbol swatch in pixels.
swatchwidth Width of the symbol swatch in pixels.
title Title of legend.
titlefontsize Font size for title.
transcolor Transparency color using RGB values. White is 255,255,255.
valuefontsize Font size for value map labels.
width Legend width in pixels.
 

Examples for LEGEND:

Example 1: When in an IMAGE response with no restrictions on LEGEND. Back to Top
<?xml version="1.0" encoding="UTF8"?>
<ARCXML version="1.1">
  <RESPONSE>
    <IMAGE>
      <LEGEND file="D:\ArcIMS\output\Iextensions_MYMACHINE4094163.jpg" url="http://mymachine.domain.com/output/Iextensions_MYMACHINE4094163.jpg" />
    </IMAGE>
  </RESPONSE>
</ARCXML>

Example 2: GET_IMAGE request 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">
  <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 3: 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" />
      <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 4: When in an IMAGE response and LEGEND is restricted. Back to Top
<?xml version="1.0" encoding="UTF8"?>
<ARCXML version="1.1">
  <RESPONSE>
    <IMAGE>
      <LEGEND url="http://mymachine.domain.com/output/Iextensions_MYMACHINE4094163.jpg" />
    </IMAGE>
  </RESPONSE>
</ARCXML>