[mapserver-users] Mapserver Legend using html template
Paul Maddock
Paul.Maddock at ijus.net
Wed May 30 14:30:51 PDT 2012
Dear All,
I'm currently trying to make mapserver show in a legend different classes in the same layer. Right now the classes are rendered using the same shape (point) and different colors correctly based on expressions in each class of the layer. The legend works correctly when I turn on another line layer without classes.
Below I've included snippets (Legend tag, layer tag) from my mapfile, and one from my html template. Maybe you can tell me what I'm doing wrong because I cannot find any discrepancies between what the documentation says to do and what I have.
Here is the Legend tag in my mapfile:
LEGEND
STATUS ON
POSITION LR
IMAGECOLOR 237 248 177
END
Here is a sample from the layer I'm trying to put into the legend
LAYER
NAME "jobstatus"
STATUS ON
#GROUP "default"
TYPE POINT
CONNECTIONTYPE postgis
CONNECTION "host=localhost dbname=jobstatus2012 user=*****password=****** port=5432"
#MAXSCALEDENOM 10000
DATA "geom from statusb5_19_2012 using unique proposal_n using srid=3754"
PROJECTION
"init=epsg:3754"
END
CLASSITEM 'proposal_n'
LABELITEM 'proposal_n'
CLASSGROUP "status"
CLASS
NAME "status1"
GROUP "status1"
EXPRESSION ( '[current_st]' eq 'Remediation')
STYLE
SYMBOL "circle"
COLOR 96 225 9
OUTLINECOLOR 96 225 9
SIZE 3
END
LABEL
COLOR 0 0 0
OUTLINECOLOR 0 0 0
POSITION AUTO
END
END
CLASS
NAME "status2"
GROUP "status2"
EXPRESSION ( '[current_st]' eq 'New Proposal')
STYLE
SYMBOL "circle"
COLOR 251 240 28
OUTLINECOLOR 251 240 28
SIZE 3
END
LABEL
COLOR 0 0 0
OUTLINECOLOR 0 0 0
POSITION AUTO
END
END
CLASS
NAME "status3"
GROUP "status3"
EXPRESSION ( '[current_st]' eq 'Data Collection')
STYLE
SYMBOL "circle"
COLOR 39 29 250
OUTLINECOLOR 39 29 250
SIZE 3
END
LABEL
COLOR 0 0 0
OUTLINECOLOR 0 0 0
POSITION AUTO
END
END
Finally here is a sample from my html template
<HR><IMG SRC="[legend]"><HR>
Thanks to anyone who can help!
Paul A. Maddock
Mapping Technician
IJUS LLC
560 Officenter Place
Gahanna, OH 43230
Cell: (513) 404-6476
[cid:image001.gif at 01CD3E74.0915E250]<http://www.ijus.net/index.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120530/13d4c13e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 3201 bytes
Desc: image001.gif
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120530/13d4c13e/attachment.gif>
More information about the MapServer-users
mailing list