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, <br> visibility: true<br> }),<br><br> 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><br>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><br>Thank you!<br><br>Stella<br><br><br><div class="gmail_quote">2010/1/6 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">On 2010-01-06 18:34, stela anders wrote:<br>
> Thanks again...<br>
> I have 3 layers, each one has several sublayers.... :<br>
> OpenLayers.Layer.WMS("Layer1", ...<br>
> OpenLayers.Layer.WMS("Layer2",<br>
> OpenLayers.Layer.WMS("Layer3",<br>
<br>
<br>
</div>GeoExt/OpenLayers does not know about your sublayers in this case.<br>
<div class="im"><br>
> But my legend only prints one Label ("Layer1") .... None imagens at<br>
> all... And just for the first layer...<br>
<br>
</div>And do you also just see "Layer1" on your map? If so, then probably all<br>
your WMS layers are configured as base layers, only one of which can be<br>
visible at a time. The legend should show all the layers that are<br>
visible on the map, at least the labels with the layer names.<br>
<div class="im"><br>
> Is there anything else to implement ? Maybe in mapfile?<br>
<br>
</div>I don't know much about MapServer, but I guess you have to configure<br>
something in your mapfile so MapServer can return a legend graphic.<br>
Search the MapServer documentation for GetLegendGraphic, as this is the<br>
request that GeoExt sends to the server to get the images.<br>
<br>
Regards,<br>
Andreas.<br>
<div class="im"><br>
<br>
><br>
> Stella<br>
><br>
><br>
><br>
> 2010/1/6 Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a><br>
</div>> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>>><br>
<div class="im">><br>
> On 2010-01-06 18:00, stela anders wrote:<br>
> > Yeah! Thats it Andreas!<br>
> ><br>
> > That LegendPanel works with sublayers? I´m a little bit confused<br>
> right<br>
> > now!<br>
><br>
> The LegendPanel currently supports one image per layer. GeoServer's<br>
> GetLegendGraphic e.g. returns images with symbols and text for all<br>
> rules<br>
> of the SLD that was used to render the layer. I think the same is true<br>
> for MapServer, but maybe a MapServer user can give more detail about<br>
> what its GetLegendGraphic returns.<br>
><br>
> Regards,<br>
> Andreas.<br>
><br>
><br>
> ><br>
> > Thanks !<br>
> ><br>
> ><br>
> ><br>
> > 2010/1/6 Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a><br>
> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>><br>
</div><div><div></div><div class="h5">> > <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>>>><br>
> ><br>
> > Hi,<br>
> ><br>
> > make sure that your Ext JS build contains Ext.form.Label, or<br>
> use a<br>
> > full<br>
> > build. The build that most of the GeoExt exmaples use<br>
> > (<a href="http://extjs.cachefly.net/builds/ext-cdn-771.js" target="_blank">http://extjs.cachefly.net/builds/ext-cdn-771.js</a>) does not<br>
> contain it.<br>
> > Look e.g. at<br>
> > <a href="http://dev.geoext.org/trunk/geoext/examples/legendpanel.html" target="_blank">http://dev.geoext.org/trunk/geoext/examples/legendpanel.html</a>, it<br>
> > uses a<br>
> > full build.<br>
> ><br>
> > Regards,<br>
> > Andreas.<br>
> ><br>
> > On 2010-01-06 16:24, stela anders wrote:<br>
> > > Thanks Andreas !!!!<br>
> > > I changed to WMS with success...<br>
> > > But now I got that error when trying to generate the legend :<br>
> > ><br>
> > > Error: Ext.form.Label is not a constructor<br>
> > > Arquivo-fonte:<br>
> > ><br>
> ><br>
> <a href="http://localhost/Openlayer/Arquivos/geoextx/lib/GeoExt/widgets/LegendPanel.js" target="_blank">http://localhost/Openlayer/Arquivos/geoextx/lib/GeoExt/widgets/LegendPanel.js</a><br>
> > > Linha: 293<br>
> > ><br>
> > > Am I suppossed to change anything?<br>
> > ><br>
> > > Thanks<br>
> > ><br>
> > > Stella<br>
> > ><br>
> > > 2010/1/5 Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a><br>
> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>><br>
> > <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>>><br>
> > > <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>><br>
> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a> <mailto:<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>>>>><br>
> > ><br>
> > > Hi,<br>
> > ><br>
> > > On 2010-01-04 19:36, stela anders wrote:<br>
> > > > Is it possible?<br>
> > ><br>
> > > You have at least two choices:<br>
> > ><br>
> > > (1) Use Layer.WMS instead of Layer.MapServer. With minor<br>
> > modifications<br>
> > > to your mapfile, it is easy to use MapServer as WMS (see<br>
> > > <a href="http://mapserver.org/ogc/wms_server.html" target="_blank">http://mapserver.org/ogc/wms_server.html</a>). I think this is<br>
> > the best<br>
> > > option, because it will build the legend automatically<br>
> from<br>
> > > GetLegendGraphic requests.<br>
> > ><br>
> > > (2) Use a LayerStore with a legendURL field. For each<br>
> layer, you<br>
> > > have to<br>
> > > provide a URL that points to a legend image. This<br>
> option may<br>
> > only work<br>
> > > with the current trunk version of GeoExt, not with v0.6.<br>
> > ><br>
> > > Regards,<br>
> > > Andreas.<br>
> > ><br>
> > > ><br>
> > > > I tried to create that :<br>
> > > > var legendPanel = new GeoExt.LegendPanel({<br>
> > > > title: 'Legend',<br>
> > > > dynamic: true<br>
> > > > });<br>
> > > ><br>
> > > > And added to Viewport, but nothing is created...<br>
> > > ><br>
> > > > Help me please!<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > Users mailing list<br>
> > > > <a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>><br>
> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>>><br>
> > <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>><br>
> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>>>><br>
> > > > <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><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>
> > > Users mailing list<br>
> > > <a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>><br>
> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>>><br>
> > <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>><br>
</div></div><div class="im">> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>>>><br>
> > > <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
> > ><br>
> > ><br>
> > ><br>
> > > _______________________________________________<br>
> > > Users mailing list<br>
> > > <a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>><br>
</div><div class="im">> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a> <mailto:<a href="mailto:Users@geoext.org">Users@geoext.org</a>>><br>
> > > <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><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>
><br>
><br>
</div><div><div></div><div class="h5">> --<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>
--<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>
</div></div></blockquote></div><br>