.. index:: LEGEND

.. _legend:

*****************************************************************************
 LEGEND
*****************************************************************************

The size of the legend image is NOT known prior to creation so be careful 
not to hard-code width and height in the <IMG> tag in the template file.

.. index::
   pair: LEGEND; IMAGECOLOR
    
IMAGECOLOR [r] [g] [b] | [hexadecimal string]
    Color to initialize the legend with (i.e. the background).
    
    - `r`, `g` and `b` shall be integers [0..255].  To specify green,
      the following is used:

        .. code-block:: mapfile

           IMAGECOLOR 0 255 0

    - `hexadecimal string` can be

      - RGB value: "#rrggbb".  To specify magenta, the following is
        used:

        .. code-block:: mapfile

           IMAGECOLOR "#FF00FF"

      - RGBA value (adding translucence): "#rrggbbaa".  To specify a
        semi-translucent magenta, the following is used:

        .. code-block:: mapfile

           IMAGECOLOR "#FF00FFCC"       

INTERLACE [on|off]
    Default is [on]. This keyword is now deprecated in favor 
    of using the FORMATOPTION "INTERLACE=ON" line in the 
    :ref:`OUTPUTFORMAT` declaration.

    .. deprecated:: 4.6
    
.. index::
   pair: LEGEND; KEYSIZE
    
KEYSIZE [x][y]
    Size of symbol key boxes in pixels. Default is 20 by 10.

.. index::
   pair: LEGEND; KEYSPACING
    
KEYSPACING [x][y]
    Spacing between symbol key boxes ([y]) and labels ([x]) in pixels. 
    Default is 5 by 5.

.. index::
   pair: LEGEND; LABEL
    
:ref:`LABEL`
    Signals the start of a :ref:`LABEL` object

.. index::
   pair: LEGEND; OUTLINECOLOR
    
OUTLINECOLOR [r] [g] [b] | [hexadecimal string]
    Color to use for outlining symbol key boxes.
    
    - `r`, `g` and `b` shall be integers [0..255].  To specify green,
      the following is used:

        .. code-block:: mapfile

           OUTLINECOLOR 0 255 0

    - `hexadecimal string` can be

      - RGB value: "#rrggbb".  To specify magenta, the following is
        used:

        .. code-block:: mapfile

           OUTLINECOLOR "#FF00FF"

      - RGBA value (adding translucence): "#rrggbbaa".  To specify a
        semi-translucent magenta, the following is used:

        .. code-block:: mapfile

           OUTLINECOLOR "#FF00FFCC"        

.. index::
   pair: LEGEND; POSITION
    
POSITION [ul|uc|ur|ll|lc|lr]
    Where to place an embedded legend in the map. Default is lr.

.. index::
   pair: LEGEND; POSTLABELCACHE
    
POSTLABELCACHE [true|false]
    Tells MapServer to render this legend after all labels in the cache have 
    been drawn. Useful for adding neatlines and similar elements. 
    Default is false.

.. index::
   pair: LEGEND; STATUS
    
STATUS [on|off|embed]
    Is the legend image to be created.

.. index::
   pair: LEGEND; TEMPLATE
    
TEMPLATE [filename]
    HTML legend template file.  
     
    .. seealso::
        
        :ref:`html_legend`

.. index::
   pair: LEGEND; TRANSPARENT
    
TRANSPARENT [on|off]
    Should the background color for the legend be transparent. 
    This flag is now deprecated in favor of declaring transparency within 
    :ref:`OUTPUTFORMAT` declarations. Default is off.
    
    .. deprecated:: 4.6
