Thanks Andreas...<br><br>The fact is :<br> - Now I have all image symbol in png format<br> - My mapfile is configured to generate PNG images<br> - My legendPanel:<br><br>var legendPanel = new GeoExt.LegendPanel({<br> defaults: { <br>
style: 'padding:5px',<br> imageFormat: "image/png" <br> },<br> title: 'Legend',<br> bodyStyle: 'padding:5px',<br> width: 350,<br> autoScroll: true <br>
});<br><br><br>But the legend url generated my GeoExt is:<br><br><a href="http://localhost/cgi-bin/mapserv.exe?MAP=Map.map&TRANSPARENT=true&FORMAT=image%2Fgif&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=Roads">http://localhost/cgi-bin/mapserv.exe?MAP=Map.map&TRANSPARENT=true&FORMAT=image%2Fgif&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=Roads</a> <br>
<br>It is in GIF, why? If I manually change to "...&FORMAT=image%2Fpng" the legend is generated fine...<br><br>Any help?<br><br>Thanks<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;">
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>
</blockquote>
<br></div>
Not a GeoExt issue for sure. GeoExt just loads the image and displays it in its original extent and dimensions. But you could define a png24 format in your mapfile, and configure your legendPanel with something like<br>
<br>
defaults: {imageFormat: "image/png"}<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Any idea why that? Or maybe is a restriction?<br>
</blockquote>
<br></div>
Again, you might want to ask about GetLegendGraphic on the mapserver users list or look in the mapserver docs.<br>
<br>
Regards,<br>
Andreas.<br>
<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">
<br>
Thanks so much! U r saving my week ;)<br>
<br>
Stella<br>
<br></div>
2010/1/8 Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a> <mailto:<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>>><div><div></div>
<div class="h5"><br>
<br>
stela anders wrote:<br>
<br>
Hello Andreas...<br>
<br>
All sublayers is with status ON, they are draw on map, but in my<br>
legend I got ONLY "Layer1" label printed...<br>
My layers:<br>
OpenLayers.Layer.WMS("Layer1",<br>
mycgi, {<br>
map: mymapfile,<br>
layers: ['Sublayer11','Sublayer12',<br>
'Sublayer13'],<br>
format: "image/png",<br>
transparent: "true"<br>
}, {<br>
isBaseLayer: true, visibility: true<br>
}),<br>
<br>
<br>
The above should cause three GetFeatureInfo requests to be issued:<br>
one for each of your sublayers. If you just see the label, then<br>
MapServer does not send you an image on the GetFeatureInfo request.<br>
Here is what you can try: enable the Net panel on firebug and look<br>
at the GetFeatureInfo request that the browser issues. Copy them,<br>
open them in a browser window/tab, and fix your mapfile until they<br>
work (more help available in mapserver docs/lists).<br>
<br>
<br>
OpenLayers.Layer.WMS("Layer2",<br>
mycgi, {<br>
map: mymapfile,<br>
layers: ['Sublayer21','Sublayer22',<br>
'Sublayer23'],<br>
format: "image/png",<br>
transparent: "true"<br>
}, {<br>
isBaseLayer: false,<br>
displayInLayerSwitcher: false,<br>
visibility: true<br>
}),<br>
<br>
<br>
This won't display anything, because you have set<br>
"displayInLayerSwitcher" to false.<br>
<br>
So, What is your suggestion in building a legend to Map with<br>
GeoExt sublayers? I need all sublayers appears on my legend<br>
(each one has different images...)<br>
<br>
<br>
The LegendPanel does exactly that. It requests one image per<br>
sublayer (now that you provided a code snippet and I finally know<br>
what you meant by "sublayer"). My suggestion is: fix your mapfile so<br>
Mapserver can answer GetFeatureInfo requests correctly.<br>
<br>
Regards,<br>
Andreas.<br>
<br>
-- Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
<br>
<br>
</div></div></blockquote><div><div></div><div class="h5">
<br>
<br>
-- <br>
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>