<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:TSTAR;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texte de bulles Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.TextedebullesCar
        {mso-style-name:"Texte de bulles Car";
        mso-style-priority:99;
        mso-style-link:"Texte de bulles";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1857646931;
        mso-list-type:hybrid;
        mso-list-template-ids:1585111966 -224655860 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:20.5pt;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:56.5pt;
        text-indent:-18.0pt;
        font-family:"Courier New","serif";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:92.5pt;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:128.5pt;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:164.5pt;
        text-indent:-18.0pt;
        font-family:"Courier New","serif";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:200.5pt;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:236.5pt;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:272.5pt;
        text-indent:-18.0pt;
        font-family:"Courier New","serif";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:308.5pt;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I&#8217;m working on a web app with PostGis/mapserver/GeoExt1.1/Openlayers/ExtJS.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>In a layertree, I add WMSlegends from WMS layers generated on the fly by phpmapscript.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I get one image per layer with every class and class names (one legend for a layer = one image), cf. code at the bottom of my message : <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>X Layer 1 <o:p></o:p></span></p><p class=MsoNormal style='margin-left:2.5pt'><span lang=EN-US>---&gt; 1 image for 2 class<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Now, I would like to achieve this in a different way and get each legend boxes + title separately (one class = one image + class name) to interact with each layer class with mapscript<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>X Layer 1 <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> ---&gt; class 1: image1 name1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> ---&gt; class 2: image2 name2<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>I saw that i can use RULE parameter in the getLegendGraphic request, but how identify my RULES/Classes from a WMS layer? <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Any idea is welcome !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Frédéric Bray <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Irstea Grenoble<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Here is the (classic) part of code I use for now to create nodes for each layer in my layercontainer:   <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>       <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>          createNode: function(attr) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    // add a WMS legend to each node created<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    attr.component = {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        xtype: &quot;gx_wmslegend&quot;,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        layerRecord: mapPanel.layers.getByLayer(attr.layer),<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        showTitle: false,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        // custom class for css positioning<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        // see tree-legend.html<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        cls: &quot;legend&quot;,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        style: 'padding-left:45px',<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                        baseParams: {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                     FORMAT: 'image/png',<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                     LEGEND_OPTIONS: 'forceLabels:on'<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                    }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    } ;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    attr.listeners = <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                                                                                                {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                                                                                                              click :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                               function (){<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                // Action on legend click<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                }//End fonction <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                             } //End listener <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                               <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                    return GeoExt.tree.LayerParamLoader.prototype.createNode.call(this, attr);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                </span>}<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:#003980;mso-fareast-language:FR'>Frédéric Bray </span><span style='font-size:9.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#009EE0;mso-fareast-language:FR'>Pôle Système d'information UR DTM</span><span style='font-size:9.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#009EE0;mso-fareast-language:FR'>Irstea -</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue;mso-fareast-language:FR'>&nbsp;</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#009EE0;mso-fareast-language:FR'>Grenoble</span><span style='font-size:9.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#009EE0;mso-fareast-language:FR'>2, rue de la Papeterie</span><span style='font-size:9.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#009EE0;mso-fareast-language:FR'>38402 Saint Martin d'Hères</span><span style='font-size:5.5pt;font-family:TSTAR;color:#009DE0;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#003980;mso-fareast-language:FR'>+33&nbsp;</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#009DE0;mso-fareast-language:FR'>(</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#003980;mso-fareast-language:FR'>0</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#009DE0;mso-fareast-language:FR'>)4</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#003980;mso-fareast-language:FR'> 76 76 27 74</span><span style='font-size:5.5pt;font-family:TSTAR;color:#009DE0;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#003A80;mso-fareast-language:FR'><a href="http://www.irstea.fr/" title="blocked::http://www.irstea.fr/"><span style='color:blue'>www.irstea.fr</span></a></span><span style='font-size:5.5pt;font-family:TSTAR;color:#009DE0;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:5.5pt;font-family:"Courier New","serif";color:#009DE0;mso-fareast-language:FR'>&nbsp;</span><span style='font-size:5.5pt;font-family:TSTAR;color:#009DE0;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:5.5pt;font-family:"Courier New","serif";color:#009DE0;mso-fareast-language:FR'>&nbsp;</span><span style='font-size:5.5pt;font-family:TSTAR;color:#009DE0;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#810081;mso-fareast-language:FR'><img border=0 width=68 height=66 id="Image_x0020_1" src="cid:image001.gif@01CF5016.5DD2C370" alt="Description&nbsp;: cid:image001.gif@01CE6079.63F47EC0"></span><span style='font-size:6.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:6.0pt;font-family:"Courier New","serif";color:#003980;mso-fareast-language:FR'>&nbsp;</span><span style='font-size:6.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#003A80;mso-fareast-language:FR'>Pour mieux affirmer ses missions,</span><span style='font-size:6.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#003A80;mso-fareast-language:FR'>le Cemagref devient Irstea </span><span style='font-size:6.0pt;font-family:TSTAR;color:#003980;mso-fareast-language:FR'><o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>