Pas de progression aujourd'hui ... toute aide est bienvenue :)<br><br><div class="gmail_quote">2010/12/14 Rémi Lagoin <span dir="ltr"><<a href="mailto:remi.lagoin@gmail.com">remi.lagoin@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks Andreas,<br><br><span lang="en"><span title="">I
also tried this example, the legendPanel works well, printing the PDF
is done, but I only have the layer name in the caption, not the legend image associated.</span></span><br><br>Here is my code :<br><br>--------------<br>var mapPanel, printPage;<br><br>Ext.onReady(function() {<br> // The printProvider that connects us to the print service<br>
var printProvider = new GeoExt.data.PrintProvider({<br> method: "GET", // "POST" recommended for production use<br> capabilities: printCapabilities // from the info.json script in the html<br>
});<br> // Our print page. Tells the PrintProvider about the scale and center of<br> // our page.<br> printPage = new GeoExt.data.PrintPage({<br> printProvider: printProvider,<br> customParams: {<br>
mapTitle: "Printing Demo",<br> comment: "This is a simple map printed from GeoExt.",<br> copyright: "This is a simple map printed from GeoExt."<br> }<br>
});<br> <br> feux = new OpenLayers.Layer.WMS("feux", "<a href="http://xxxx/feux" target="_blank">http://xxxx/feux</a>",<br> {layers: "feux", format: 'image/jpeg', transparent: true}, {singleTile: true});<br>
<br> // The map we want to print<br> mapPanel = new GeoExt.MapPanel({<br> region: "center",<br> layers: [feux],<br> center: [146.56, -41.56],<br> zoom: 6<br> });<br>
<br> // The legend to optionally include on the printout<br> var legendPanel = new GeoExt.LegendPanel({<br> region: "west",<br> width: 150,<br> bodyStyle: "padding:5px",<br>
layerStore: mapPanel.layers,<br>
defaults: {<br> style: 'padding:5px',<br> baseParams: {<br> FORMAT: 'image/png',<br> LEGEND_OPTIONS: 'forceLabels:on'<br> }<br> }<br><br> });<br>
<br> mapPanel.map.addControl(new OpenLayers.Control.LayerSwitcher());<br> <br> var includeLegend; // controlled by the "Include legend?" checkbox<br> <br> // The main panel<br> new Ext.Panel({<br>
renderTo: "content",<br> layout: "border",<br> width: 700,<br> height: 420,<br> items: [mapPanel, legendPanel],<br> bbar: ["->", {<br> text: "Print",<br>
handler: function() {<br> // convenient way to fit the print page to the visible map area<br> printPage.fit(mapPanel, true);<br> // print the page, optionally including the legend<br>
printProvider.print(mapPanel, printPage, includeLegend && {legend: legendPanel});<br> }<br> }, {<br> xtype: "checkbox",<br> boxLabel: "Include legend?",<br>
handler: function() {includeLegend = this.checked}<br> }]<br> });<br>});<br>-----------<br>And an extract of my Yaml config :<br><br> - !columns<br> widths: [100]<br> absoluteX: 300<br>
spacingAfter: 5<br> items:<div class="im"><br> - !legends<br> maxIconWidth: 0<br> maxIconHeight: 0<br> classIndentation: 0<br> layerSpace: 5<br>
layerFontSize: 10<br>
<br><br></div>Is something wrong ?<br><br>Thanks a lot,<br><br>Rémi<br><br><br><br><div class="gmail_quote">2010/12/13 Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>></span><div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
have you tried to do something like in this example in your code:<br>
<a href="http://api.geoext.org/1.0/examples/print-page.html" target="_blank">http://api.geoext.org/1.0/examples/print-page.html</a><br>
<br>
The essential part is to call the PrintProvider's print method with an additional option, e.g.<br>
<br>
printProvider.print(mapPanel, printPage, {legend: legendPanel});<br>
<br>
Also note that it is required to configure the server's config.yaml accordingly, as described here:<br>
<a href="http://api.geoext.org/1.0/docs/lib/GeoExt/data/PrintProvider.html" target="_blank">http://api.geoext.org/1.0/docs/lib/GeoExt/data/PrintProvider.html</a><br>
<br>
- !legends<br>
maxIconWidth: 0<br>
maxIconHeight: 0<br>
classIndentation: 0<br>
layerSpace: 5<br>
layerFontSize: 10<br>
<br>
Regards,<br>
Andreas.<br>
<div><div></div><div><br>
On Dec 13, 2010, at 18:10 , Rémi Lagoin wrote:<br>
<br>
> Hi all,<br>
><br>
> I try to use the form print PDF GeoExt based servlet mapfish geoext as in the example (1).<br>
> The PDF generation is going well but I can not get the icons of the layers in the legend, I get only the name of the active layers.<br>
><br>
> I use a TreePanel (with captions for each layer), a legendPanel (because I assume that its presence is essential to display the caption in the PDF?), And a MapPanel (required I guess).<br>
><br>
> I also tried the Geoext.ux.SimplePrint, but no more success ... it gives me no icons layers ...<br>
><br>
> The inclusion of the legend went very well with the widget mapfish (LayerTree) I feel that this is not so simple with a TreePanel and legendPanel ...<br>
><br>
> Do you have any advice for me because I do not know what to do to move forward ...<br>
><br>
> Thanks a lot!<br>
> Remi<br>
><br>
</div></div>> 1 - <a href="http://api.geoext.org/1.0/examples/print-form.html" target="_blank">http://api.geoext.org/1.0/examples/print-form.html</a> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@geoext.org" target="_blank">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>
<font color="#888888"><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>
</font></blockquote></div></div></div><br>
</blockquote></div><br>