WMS server - legend graphic/symbology

Bart van den Eijnden BEN at SYNCERA-ITSOLUTIONS.NL
Fri Jun 24 11:08:08 EDT 2005


Kevin,

in the WMS interface you cannot specify whether a layer should be initially on or off. You just advertize the layers available on the server, and the client determines which ones it requests.

OGC has invented the Web Map Context (WMC) standard to do the stuff you talk about, which is like an initial application state, so in a WMC document you can state which layers should be initially on or off. I don't think ArcMap supports WMC though.

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl

>>> Kevin Grootendorst <kgrootendorst at BAIRD.COM> 06/24/05 05:00pm >>>
Bart,
Thanks for your suggestion.
I added NAME " " to the CLASS object and everything works as expected.

Do you know why ALL the wms layers would be turned 'on' while viewing in
ArcMap?  I assumed that only the layers with STATUS ON would be visible
initially.

The log that ArcMap sends is as follows:
"GET /cgi-bin/mapserv.exe?map=/web/maplab-
2.2/Pelee/Pelee.map&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:26917&BBOX=298978.
084774465,4606186.14109543,512740.303618177,4785860.76331283&WIDTH=972&HEIGH
T=817&LAYERS=Municipalities_coarse,Cities&STYLES=&EXCEPTIONS=application/vnd
..ogc.se_xml&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE HTTP/1.1"
200 53798

The 'cities' layer is set to Status OFF, but still draws when the service
is first added to ArcMap.

Kevin
On Fri, 24 Jun 2005 16:48:29 +0200, Bart van den Eijnden <BEN at SYNCERA-
ITSOLUTIONS.NL> wrote:

>You always need to add a NAME to the CLASS which you want Mapserver to
show in the legend.
>
>Not sure if this will get you through showing the legend in ArcMap though.
Try and log the request that ArcMap is sending.
>
>Does Mapserver put a LegendURL in your WMS capabilities and does it work?
I am assuming ArcMap will use that for input.
>
>Best regards,
>Bart
>
>Bart van den Eijnden
>Syncera IT Solutions
>Postbus 270
>2600 AG  DELFT
>
>tel.nr.: 015-7512436
>email: BEN at Syncera-ITSolutions.nl 
>
>>>> Kevin Grootendorst <kgrootendorst at BAIRD.COM> 06/24/05 04:44pm >>>
>Hi,
>I have a map file which I'm setting up as a WMS server, so that I can view
>my data in ArcMap 9.
>I'm successful in viewing the WMS in ArcMap, however it does not contain a
>graphic in the legend.  In other words, the layers draw correctly (with
>same colors as in the map file), but the legend does not indicate any
>symbology.
>
>Any ideas how I can get the legend symbology to show?
>Using MS 4.4 on win2000.
>
>Below is a snippet from my .map file:
>(web definition:)
>WEB
>    IMAGEPATH "C:/web/ms_tmp/"
>    IMAGEURL "/ms_tmp/"
>  METADATA
>     "wms_title" "Pelee WMS"
>     "wms_onlineresource" "http://maps.baird.com/cgi-bin/mapserv.exe? 
>map=/web/maplab-2.2/Pelee/Pelee.map&"
>     "wms_srs" "EPSG:26917"
>     "wms_abstract" "Pelee WMS server"
>            "wms_style" ""
>   END
>  END # END OF WEB SECTION
>
>(layer definition):
>LAYER
>    #NAME "Municipalities (coarse)"
>    NAME "Municipalities_coarse"
>    GROUP "BASE"
>    METADATA
> "wms_title" "Municipalities"
>        "wms_srs" "EPSG:26917"
> "wms_style" ""
>        "wms_group_title"  "base"
>    END
>    STATUS on
>    DATA "./Municipalities"
>    TYPE POLYGON
>    UNITS METERS
>    TEMPLATE "ttt"
>    SIZEUNITS PIXELS
>    TOLERANCE 0
>    TOLERANCEUNITS PIXELS
>    LABELITEM "NAME"
>    CLASS
>    LABEL
>        TYPE BITMAP
>        SIZE tiny
>        POSITION cc
>        OFFSET 0 0
>        COLOR 100 100 100
>        #SHADOWSIZE 1 1
> OUTLINECOLOR 255 255 255
>      END
>      STYLE
>        SYMBOL 8
>        OUTLINECOLOR 0 0 0
>        BACKGROUNDCOLOR 99 99 99
>        SIZE 2
>      END
>    END
>  END



More information about the mapserver-users mailing list