Thanks Andreas... ;)<br>displayInLayerSwitcher did the trick !!!<br><br>I have some point layer with image symbol (.gif - 16x15) ... The legend icon in that case stay ugly (only part of image appears)...<br>Any idea why that? Or maybe is a restriction?<br>
<br>Thanks so much! U r saving my week ;)<br><br>Stella<br><br><div class="gmail_quote">2010/1/8 Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">stela anders wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Andreas...<br>
<br>
All sublayers is with status ON, they are draw on map, but in my legend I got ONLY "Layer1" label printed...<br>
My layers:<br>
OpenLayers.Layer.WMS("Layer1",<br>
mycgi, {<br>
map: mymapfile,<br>
layers: ['Sublayer11','Sublayer12', 'Sublayer13'],<br>
format: "image/png",<br>
transparent: "true"<br>
}, {<br>
isBaseLayer: true, visibility: true<br>
}),<br>
</blockquote>
<br></div><div class="im">
The above should cause three GetFeatureInfo requests to be issued: one for each of your sublayers. If you just see the label, then MapServer does not send you an image on the GetFeatureInfo request. Here is what you can try: enable the Net panel on firebug and look at the GetFeatureInfo request that the browser issues. Copy them, open them in a browser window/tab, and fix your mapfile until they work (more help available in mapserver docs/lists).<br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div class="im">
OpenLayers.Layer.WMS("Layer2",<br>
mycgi, {<br>
map: mymapfile,<br>
layers: ['Sublayer21','Sublayer22', 'Sublayer23'],<br>
format: "image/png",<br>
transparent: "true"<br>
}, {<br>
isBaseLayer: false,<br>
displayInLayerSwitcher: false,<br>
visibility: true<br>
}),<br>
</div></blockquote>
<br><div class="im">
This won't display anything, because you have set "displayInLayerSwitcher" to false.<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So, What is your suggestion in building a legend to Map with GeoExt sublayers? I need all sublayers appears on my legend (each one has different images...)<br>
</blockquote>
<br></div>
The LegendPanel does exactly that. It requests one image per sublayer (now that you provided a code snippet and I finally know what you meant by "sublayer"). My suggestion is: fix your mapfile so Mapserver can answer GetFeatureInfo requests correctly.<br>
<br>
Regards,<br>
Andreas.<br><font color="#888888">
<br>
-- <br></font><div><div></div><div class="h5">
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
</div></div></blockquote></div><br>