I updated GeoExt....<br>Worked fine now! <br><br>Thanks for the patience !<br><br>Stella<br><br><div class="gmail_quote">2010/1/11 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;">Hi,<br>
<br>
which version of GeoExt are you using? Providing imageFormat in defaults only works with current trunk. Version 0.6 had a different way of doing this.<br>
<br>
Regards,<br>
Andreas.<br>
<br>
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>
<br><div class="im">
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: { style: 'padding:5px',<br>
imageFormat: "image/png" },<br>
title: 'Legend',<br>
bodyStyle: 'padding:5px',<br>
width: 350,<br>
autoScroll: true });<br>
<br>
<br>
But the legend url generated my GeoExt is:<br>
<br>
</div><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" target="_blank">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> <<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" target="_blank">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>
<div class="im">
<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><div class="im">
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>>><br>
<br>
stela anders wrote:<br>
<br>
Thanks Andreas... ;)<br>
displayInLayerSwitcher did the trick !!!<br>
<br>
I have some point layer with image symbol (.gif - 16x15) ... The<br>
legend icon in that case stay ugly (only part of image appears)...<br>
<br>
<br>
Not a GeoExt issue for sure. GeoExt just loads the image and<br>
displays it in its original extent and dimensions. But you could<br>
define a png24 format in your mapfile, and configure your<br>
legendPanel with something like<br>
<br>
defaults: {imageFormat: "image/png"}<br>
<br>
<br>
Any idea why that? Or maybe is a restriction?<br>
<br>
<br>
Again, you might want to ask about GetLegendGraphic on the mapserver<br>
users list or look in the mapserver docs.<br>
<br>
Regards,<br>
Andreas.<br>
<br>
<br>
Thanks so much! U r saving my week ;)<br>
<br>
Stella<br>
<br>
2010/1/8 Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a><br></div>
<mailto:<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>
<mailto:<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>>>><br>
<br>
<br>
stela anders wrote:<br>
<br>
Hello Andreas...<br>
<br>
All sublayers is with status ON, they are draw on map,<br>
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<br>
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<br>
request.<br>
Here is what you can try: enable the Net panel on firebug and<br>
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<br>
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<br>
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>
<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>