LEGEND

Used in

CONFIG  REQUEST  RESPONSE  

Servers

Image  

Parent elements

IMAGE  PROPERTIES 

Syntax

<LEGENDAttribute Description Table

     When parent element is IMAGE:
     file="string"
     type="gif | jpg | png | png8"
     url="string"

     When parent element is PROPERTIES:
     antialiasing="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]
     layerfontcolor="0,0,0 - 255,255,255" [0,0,0]
     layerfontsize="1 - NNN" [10]
     layerfontstyle="regular | bold | italic | underline | outline | bolditalic" [bold]
     reverseorder="true | false" [false]
     splittext="string" [(cont)]
     swatchheight="integer" [14]
     swatchwidth="integer" [18]
     title="string"
     titlefontcolor="0,0,0 - 255,255,255" [0,0,0]
     titlefontsize="1 - NNN" [12]
     titlefontstyle="regular | bold | italic | underline | outline | bolditalic" [bold]
     transcolor="0,0,0 - 255,255,255"
     valuefontcolor="0,0,0 - 255,255,255" [0,0,0]
     valuefontsize="1 - NNN" [8]
     valuefontstyle="regular | bold | italic | underline | outline | bolditalic" [bold]
     width="1 - NNN" [125]
>


     When parent element is IMAGE:
          No Child Elements

     When parent element is PROPERTIES and using Image Server:
     (m)<LAYERS... />

</LEGEND >
(m):  Child element can be used multiple times.

Description

Defines the map's legend when using an Image Service.

Restrictions


Notes


Attribute Descriptions for LEGEND


When parent element is IMAGE:
AttributeUsage
fileFull 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).
typeReturned when OUTPUT method="stream" in a map configuration file for Image Services. Valid only when the Java Connector, the Web ADF for the Microsoft .NET Framework, or the Web ADF for the Java Platform is used.
urlURL used by client to retrieve legend image.

When parent element is PROPERTIES:
AttributeUsage
antialiasingUsed 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.
autoextendIf "true", automatically extends legend vertically past size specified in height, if needed.
backgroundcolorLegend?s background color using RGB values.
cansplitAllows splitting of valuemap layers between columns.
cellspacingDefines number of pixels to pad between entries.
columnsDefines number of columns in legend.
displayTurns legend on or off.
fontFont 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 Services, the font must reside on the client machine or else the system default font is used.
heightLegend height in pixels.
layerfontcolorFont color for the layer lables.
layerfontsizeFont size for the layer labels.
layerfontstyleFont color for the layer labels.
reverseorderReverse order of layers.
splittextText that displays in bottom of a column if a valuemap is carried over into the next column.
swatchheightHeight of the symbol swatch in pixels.
swatchwidthWidth of the symbol swatch in pixels.
titleTitle of legend.
titlefontcolorFont color for the legend title.
titlefontsizeFont size for the legend title.
titlefontstyleFont color for the legend title.
transcolorTransparency color using RGB values. White is 255,255,255.
valuefontcolorFont color for the value map labels.
valuefontsizeFont size for the value map labels.
valuefontstyleFont color for the value map labels.
widthLegend width in pixels.
Back to top 

Examples for LEGEND

Example 1: When in an IMAGE response and LEGEND is restricted.
<?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>

Example 2: When in an IMAGE response with no restrictions on LEGEND.
<?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 3: GET_IMAGE request where layers with ID of "0" and "1" are removed from the legend list.
<?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: Map configuration file where layers with ID of "0" and "1" are removed from the legend list.
<?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 5: When used in an IMAGE response and image is streamed using Base64 encoding.
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <RESPONSE>
    <IMAGE>
      <ENVELOPE minx="-180" miny="-135" maxx="180" maxy="135" />
      <OUTPUT type="jpg">/9j/4AAQSk ... ZJRgABZ</OUTPUT>
      <LEGEND type="jpg" >/9j/4AAQSkZJRgABAQA ... UDBAQEAZ</LEGEND>
    </IMAGE>
  </RESPONSE>
</ARCXML>

Back to top